Optimizing Shopping Experiences with Bootstrap CSS classes
Attention: Shopware from version 6.5 uses Bootstrap 5, this article is then outdated and will be revised soon.
The Shopware 6 Storefront is based on the Bootstrap framework. Due to our HC Architecture®, ThemeWare® is also completely compatible with Bootstrap.
Note: This article is intended for professionals and experts. If you are not absolutely sure, we will be happy to support you:
Bootstrap CSS classes
In this tutorial you will find an overview of the most important Bootstrap CSS classes, you can use in your Shopping Experiences.
You can easily add the following CSS Classes via the section or block settings.
Of course, you can also use the Shopware 6 HTML editor (e.g. in a CMS element) to integrate your own HTML code. Please note that the editor will automatically clean up your code – for security reasons – and not all HTML tags and CSS classes will work.
Note: dditionally we recommend our in our demo shops.
Text
For aligning texts Bootstrap provides CSS Classes you can use.
For coloring texts, Bootstrap already provides some classes for different colors. The following you will find examples of the available color variants.
The Bootstrap framework also provides you with classes for coloring backgrounds of Shopping Experience elements in different colors. For dark backgrounds it is recommended to choose a light text color (see above).
Bootstrap Classes can also be used to define the borders of Shopping Experience elements. The class "border-0" removes borders from elements, for example.
With the following Bootstrap Classes, spacings can be defined for Shopping Experience elements. There are also spacing classes for different viewports.
The classes are named according to the format {property}{page}-{size} for xs and {property}{page}-{breakpoint}-{size} for sm, md, lg and xl.
m - margin (outer spacing)
p - padding (Inner spacing)
t - top
b - bottom
l - left
sm - ab 576px
md - ab 768px
lg - ab 992px
0 - Setting spacing to 0
1 - setting spacing to $spacer * .25
2 - setting spacing to $spacer * .5
r - right
x - both *-left and*-right
y - both *-top and*-bottom
without - all 4 sides
xl - ab 1200px
ohne - ab 0px
3 - setting spacing to $spacer
4 - setting spacing to $spacer * 1,5
5 - setting spacing to $spacer * 3
auto - setting spacing to 'auto'
<p class="text-left">Left aligned text on all viewport sizes.</p>
<p class="text-center">Center aligned text on all viewport sizes.</p>
<p class="text-right">Right aligned text on all viewport sizes.</p>
<p class="text-sm-left">Left aligned text on viewports sized SM (small) or wider.</p>
<p class="text-md-left">Left aligned text on viewports sized MD (medium) or wider.</p>
<p class="text-lg-left">Left aligned text on viewports sized LG (large) or wider.</p>
<p class="text-xl-left">Left aligned text on viewports sized XL (extra-large) or wider.</p>