Bootstrap is a css framework. It provides a grid, some components and some
sass variables and mixins. This is very convenient for fast developement.
This website shows some grid and sass features. The components are useful
for a quick frontend but we lose the graphical identity. My goal is to show
that we can use bootstrap without losing our identity.
Mobile first
Bootstrap provides responsive breakpoints. That means that we can adapt the
size of our elements depending on the screen size.
The strategy chosen by bootstrap is mobile first. If we don't specify any
breakpoint, the size will apply to all screen sizes beginning by the smallest.
If we specify one, the spacing will apply to the one that is specified and
the bigger ones. Thus you need to think about what happens when the screen
size increase.
The Grid
1 of 3
2 of 3 (wider)
3 of 3
1 of 3
2 of 3 (wider)
3 of 3
1 of 3
2 of 3 (wider)
3 of 3
Horizontal alignment
One of two columns
One of two columns
One of two columns
One of two columns
One of two columns
One of two columns
One of two columns
One of two columns
One of two columns
One of two columns
Vertical alignment
One of three columns
One of three columns
One of three columns
One of three columns
One of three columns
One of three columns
One of three columns
One of three columns
One of three columns
Sass mixins (custom class)
We have this mixin:
So those two codes should render the same way:
As you can see the only difference is a padding because of the
.container class. That's why we remove it the bad way. We could also
add some padding in the .example-content-main but that's not what we
want in the current example. Another option would be to @extend .container-fluid.