Grid
v-0.0.0
This grid system is copied from bootstrap.
For more details on this please check Bootstrap documentation
How it works
Breaking it down, here's how the grid system comes together:
- Our grid supports six responsive breakpoints. Breakpoints are based on min-width media queries, meaning they affect that breakpoint and all those above it (e.g., .col-sm-4 applies to sm, md, lg, xl, and xxl). This means you can control container and column sizing and behavior by each breakpoint.
- Containers center and horizontally pad your content. Use .container for a responsive pixel width, .container-fluid for width: 100% across all viewports and devices, or a responsive container (e.g., .container-md) for a combination of fluid and pixel widths.
- Rows are wrappers for columns. Each column has horizontal padding (called a gutter) for controlling the space between them. This padding is then counteracted on the rows with negative margins to ensure the content in your columns is visually aligned down the left side. Rows also support modifier classes to uniformly apply column sizing and gutter classes to change the spacing of your content.
- Columns are incredibly flexible. There are 12 template columns available per row, allowing you to create different combinations of elements that span any number of columns. Column classes indicate the number of template columns to span (e.g., col-4 spans four). widths are set in percentages so you always have the same relative sizing.
- Gutters are also responsive and customizable. Gutter classes are available across all breakpoints, with all the same sizes as our margin and padding spacing. Change horizontal gutters with .gx-* classes, vertical gutters with .gy-, or all gutters with .g- classes. .g-0 is also available to remove gutters.
Example
One of three columns
One of three columns
One of three columns
html
<div class="container">
<div class="row">
<div class="col--12 col--md--4">
One of three columns
</div>
<div class="col--12 col--md--4">
One of three columns
</div>
<div class="col--12 col--md--4">
One of three columns
</div>
</div>
</div>Offsets
To be able to offset a column you can use the same logic with the class prefix offset.
One of three columns
One of three columns
One of three columns
One of three columns
One of three columns
html
<div class="container">
<div class="row mt--0">
<div class="col--12 col--md--4">
One of three columns
</div>
<div class="col--12 col--md--4 offset--md--4">
One of three columns
</div>
</div>
<div class="row mt--0">
<div class="col--12 col--md--3 offset--md--3">
One of three columns
</div>
<div class="col--12 col--md--3 offset--md--3">
One of three columns
</div>
</div>
<div class="row mt--0">
<div class="col--12 col--md--6 offset--md--3">
One of three columns
</div>
</div>
</div>