Grid System
Rows
Basil includes a grid system using CSS grid layout. The .row class creates a grid container with 8 equal columns.
.row {
display: grid;
grid-template-columns: repeat(8, 1fr);
grid-gap: var(--sm);
}
The
.rowclass should be used to define a horizontal row. It utilizes CSS grid layout'sgrid-template-columnsto automatically divide the row into 8 equal parts. The grid gap (spacing between cells) is defined using the small size CSS variable (--sm).For larger screens (minimum width of 764px), use
.big:rowto define a row. The functionality is the same as the.rowclass.
@media (min-width: 764px) {
.big:row {
display: grid;
grid-template-columns: repeat(8, 1fr);
grid-gap: var(--sm);
}
}
Columns
.col-1to.col-8will each span their number of columns. For example,.col-1will span 1 column, and.col-8will span 8 columns.- At a minimum screen width of 764px, the
.big:col-1to.big:col-8classes behave similarly, allowing you to adjust your layout for larger screens. You can add more breakpoints in your root CSS file if your project needs it.
.col-1 {
grid-column: span 1;
}
The same classes are also provided for larger screens (viewport width of 764px or greater), prefixed with big:.
@media (min-width: 764px) {
.big:col-1 {
grid-column: span 1;
}
}