Three types of containers: normal, wider and fluid.
There are 3 kinds of containers, .container
, .container-wider
and .container-fluid
. We can use them to build whether a simple layout or a complex layout.
A container doesn't have a center alignment, we need to use .flex-center
as a wrapper.
Here are the most common layout mode:
Let's start from a simple container
:
<div class="flex-center">
<div class="container">
Content
</div>
</div>
container-wider
has a wider width:
<div class="flex-center">
<div class="container-wider">
Content
</div>
</div>
It's easy to add a sidebar for container-wider
:
<div class="flex-center">
<div class="container-wider">
<div class="flex-left flex-wrap units-gap-big">
<div class="unit-1-4 unit-1-on-mobile">
Sidebar
</div>
<div class="unit-3-4 unit-1-on-mobile">
Content
</div>
</div>
</div>
</div>
In the above case, sidebar will have 1/4 width on desktop and will fill the whole width on mobile.
Sometimes we need to hide the sidebar on mobile.
We can add hide-on-mobile
to sidebar to achieve this:
<div class="flex-center">
<div class="container-wider">
<div class="flex-left units-gap-big">
<div class="unit-1-4 hide-on-mobile">
Sidebar
</div>
<div class="unit-3-4 unit-1-on-mobile">
Content
</div>
</div>
</div>
</div>
Sidebar can also has fixed width:
<div class="flex-center">
<div class="container-wider">
<div class="flex-left flex-wrap units-gap-big">
<div class="unit-0 unit-1-on-mobile" style="width:300px">
Sidebar
</div>
<div class="unit">
Content
</div>
</div>
</div>
</div>
We can add two sidebars:
<div class="flex-center">
<div class="container-wider">
<div class="flex-left units-gap-big">
<div class="unit-0 hide-on-mobile" style="width:200px">
Sidebar
</div>
<div class="unit">
Content
</div>
<div class="unit-0 hide-on-mobile" style="width:200px">
Sidebar
</div>
</div>
</div>
</div>
container-fluid
will fill the whole width of the browser:
<div class="flex-center">
<div class="container-fluid">
Content
</div>
</div>
Usually there is a fixed width sidebar in container-fluid
:
<div class="flex-center">
<div class="container-wider">
<div class="flex-left flex-wrap units-gap-big">
<div class="unit-0 unit-1-on-mobile" style="width:300px">
Sidebar
</div>
<div class="unit">
Content
</div>
</div>
</div>
</div>