2017-09-19 16:36:10 +02:00
|
|
|
/* --------------------------------------- */
|
|
|
|
/* ==Grillade : ultra light Grid System */
|
|
|
|
/* --------------------------------------- */
|
|
|
|
// WARNING: THIS IS NOT A COMPLETE GRID FRAMEWORK, just ultra light Grid System
|
|
|
|
// if you need complex Grid :
|
|
|
|
// 1- use vanilla CSS Grid Layout spec (perfect for you)
|
|
|
|
// 2- use Bootstrap (good luck)
|
|
|
|
|
2017-12-04 17:11:58 +01:00
|
|
|
// use these variables only for a standalone Grillade
|
2017-12-04 17:54:43 +01:00
|
|
|
// in KNACSS, you shall modify variables file instead
|
2017-12-04 17:11:58 +01:00
|
|
|
$tiny: 480px !default;
|
|
|
|
$medium: 768px !default;
|
|
|
|
|
2018-01-04 11:10:34 +01:00
|
|
|
// classic Grid
|
2017-09-19 16:36:10 +02:00
|
|
|
[class*=" grid-"],
|
|
|
|
[class^="grid-"] {
|
|
|
|
@media (min-width: $tiny) {
|
|
|
|
display: grid;
|
|
|
|
grid-auto-flow: dense;
|
|
|
|
|
|
|
|
// gutters
|
|
|
|
@if variable_exists(grid-gutters) {
|
|
|
|
$gutter: $grid-gutters !global;
|
|
|
|
}
|
|
|
|
@else {
|
|
|
|
$gutter: ( '': 1rem, '-l': 2rem, '-xl': 4rem ) !global;
|
|
|
|
}
|
|
|
|
@each $affix, $size in $gutter {
|
|
|
|
&.has-gutter#{$affix} {
|
|
|
|
grid-gap: $size;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-04 11:10:34 +01:00
|
|
|
// autogrid
|
|
|
|
.autogrid,
|
|
|
|
.grid {
|
|
|
|
@media (min-width: $tiny) {
|
|
|
|
display: grid;
|
|
|
|
grid-auto-flow: column;
|
|
|
|
grid-auto-columns: 1fr;
|
|
|
|
|
|
|
|
// gutters
|
|
|
|
@if variable_exists(grid-gutters) {
|
|
|
|
$gutter: $grid-gutters !global;
|
|
|
|
|
|
|
|
} @else {
|
|
|
|
$gutter: ( '': 1rem, '-l': 2rem, '-xl': 4rem ) !global;
|
|
|
|
}
|
|
|
|
@each $affix, $size in $gutter {
|
|
|
|
&.has-gutter#{$affix} {
|
|
|
|
grid-column-gap: $size;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-09-24 09:22:43 +02:00
|
|
|
// grid constructor (.grid-2 to .grid-$cols)
|
2018-09-24 09:14:03 +02:00
|
|
|
@for $i from 2 through $cols {
|
2017-09-19 16:36:10 +02:00
|
|
|
[class*="grid-#{$i}"] {
|
|
|
|
grid-template-columns: repeat(#{$i}, 1fr);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-09-24 09:14:03 +02:00
|
|
|
// grid items constructor (.col-1 to .col-$cols, .row-1 to .row-$cols)
|
|
|
|
@for $i from 1 through $cols {
|
2017-09-19 16:36:10 +02:00
|
|
|
[class*="col-#{$i}"] {
|
|
|
|
grid-column: auto / span #{$i};
|
|
|
|
}
|
|
|
|
|
|
|
|
[class*="row-#{$i}"] {
|
|
|
|
grid-row: auto / span #{$i};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* intermediate breakpoints */
|
|
|
|
// -small-X suffix means "X columns when < medium screen"
|
|
|
|
// example : .grid-4-small-2 will be 1 column (< tiny) then 2 columns (< medium) then 4 columns
|
|
|
|
@media (min-width: $tiny) and (max-width: ($medium - 1)) {
|
|
|
|
@for $i from 1 through 4{
|
|
|
|
[class*="grid-"][class*="-small-#{$i}"] {
|
|
|
|
grid-template-columns: repeat(#{$i}, 1fr);
|
|
|
|
}
|
|
|
|
|
|
|
|
[class*="col-"][class*="-small-#{$i}"] {
|
|
|
|
grid-column: auto / span #{$i};
|
|
|
|
}
|
|
|
|
}
|
2018-05-11 19:53:09 +02:00
|
|
|
|
2017-09-19 16:36:10 +02:00
|
|
|
[class*="-small-all"] {
|
|
|
|
grid-column: 1 / -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// grid order
|
|
|
|
.item-first {
|
|
|
|
order: -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
.item-last {
|
|
|
|
order: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// grid offset
|
|
|
|
.grid-offset {
|
|
|
|
visibility: hidden;
|
|
|
|
}
|
|
|
|
|
2018-10-31 08:18:22 +01:00
|
|
|
// spanning all columns or rows
|
2017-09-19 16:36:10 +02:00
|
|
|
.col-all {
|
|
|
|
grid-column: 1 / -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
.row-all {
|
|
|
|
grid-row: 1 / -1;
|
|
|
|
}
|