2017-08-01 12:33:42 +02:00
|
|
|
/* --------------------------------------- */
|
|
|
|
/* ==Grillade : ultra light Grid System */
|
|
|
|
/* --------------------------------------- */
|
|
|
|
/* Doc : @TODO */
|
|
|
|
// 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)
|
2016-10-27 14:35:07 +02:00
|
|
|
|
2017-08-04 09:12:58 +02:00
|
|
|
@if (not variable_exists(tiny)) or (not variable_exists(small)) or (not variable_exists(medium))
|
|
|
|
{
|
|
|
|
$tiny: 480px !global;
|
|
|
|
$small: 576px !global;
|
|
|
|
$medium: 768px !global;
|
|
|
|
}
|
|
|
|
|
2017-08-01 12:33:42 +02:00
|
|
|
[class*=" grid-"],
|
|
|
|
[class^="grid-"] {
|
|
|
|
@media (min-width: $tiny) {
|
|
|
|
display: grid;
|
|
|
|
grid-auto-flow: dense;
|
2016-05-23 14:28:55 +02:00
|
|
|
|
2017-08-01 12:33:42 +02:00
|
|
|
// 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;
|
2016-05-23 14:28:55 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-08-01 12:33:42 +02:00
|
|
|
}
|
2016-05-23 14:28:55 +02:00
|
|
|
|
2017-08-01 12:33:42 +02:00
|
|
|
// grid constructor (.grid-2 to .grid-12)
|
2017-08-02 15:17:09 +02:00
|
|
|
@for $i from 1 through 12 {
|
2017-08-01 12:33:42 +02:00
|
|
|
[class*="grid-#{$i}"] {
|
|
|
|
grid-template-columns: repeat(#{$i}, 1fr);
|
2016-05-23 14:28:55 +02:00
|
|
|
}
|
2016-10-27 14:35:07 +02:00
|
|
|
}
|
2016-05-23 14:28:55 +02:00
|
|
|
|
2017-08-02 15:17:09 +02:00
|
|
|
// grid items constructor (.col-1 to .col-12, .row-1 to .row-12)
|
|
|
|
@for $i from 1 through 12 {
|
2017-08-01 12:33:42 +02:00
|
|
|
[class*="col-#{$i}"] {
|
|
|
|
grid-column: auto / span #{$i};
|
2016-10-27 14:35:07 +02:00
|
|
|
}
|
2017-08-01 12:33:42 +02:00
|
|
|
|
|
|
|
[class*="row-#{$i}"] {
|
|
|
|
grid-row: auto / span #{$i};
|
2016-09-21 11:05:00 +02:00
|
|
|
}
|
|
|
|
}
|
2016-12-08 14:24:27 +01:00
|
|
|
|
2017-08-01 12:33:42 +02:00
|
|
|
/* intermediate breakpoint */
|
|
|
|
// -small-X suffix means "X columns when < small screen"
|
|
|
|
// example : .grid-4-small-2 will be 1 column (< tiny) then 2 columns (< small) then 4 columns
|
2017-08-01 15:25:15 +02:00
|
|
|
@media (min-width: $tiny) and (max-width: ($medium - 1)) {
|
2017-08-01 12:33:42 +02:00
|
|
|
@for $i from 1 through 4{
|
|
|
|
[class*="grid-"][class*="-small-#{$i}"] {
|
|
|
|
grid-template-columns: repeat(#{$i}, 1fr);
|
|
|
|
}
|
2016-05-23 14:28:55 +02:00
|
|
|
|
2017-08-01 12:33:42 +02:00
|
|
|
[class*="col-"][class*="-small-#{$i}"] {
|
|
|
|
grid-column: auto / span #{$i};
|
|
|
|
}
|
|
|
|
}
|
2017-08-02 15:17:09 +02:00
|
|
|
[class*="-small-all"] {
|
|
|
|
grid-column: 1 / -1;
|
|
|
|
}
|
2016-09-21 11:05:00 +02:00
|
|
|
}
|
2016-12-08 14:24:27 +01:00
|
|
|
|
2017-08-01 12:33:42 +02:00
|
|
|
// grid order
|
2016-11-10 16:45:11 +01:00
|
|
|
.item-first {
|
2016-09-21 11:05:00 +02:00
|
|
|
order: -1;
|
2016-05-23 14:28:55 +02:00
|
|
|
}
|
|
|
|
|
2016-11-10 16:45:11 +01:00
|
|
|
.item-last {
|
2016-09-21 11:05:00 +02:00
|
|
|
order: 1;
|
|
|
|
}
|
2016-05-23 14:28:55 +02:00
|
|
|
|
2017-08-01 12:33:42 +02:00
|
|
|
// grid offset
|
|
|
|
.grid-offset {
|
|
|
|
visibility: hidden;
|
2016-09-21 11:05:00 +02:00
|
|
|
}
|
2017-08-01 12:33:42 +02:00
|
|
|
|
|
|
|
// spanning all collumns or rows
|
|
|
|
.col-all {
|
|
|
|
grid-column: 1 / -1;
|
2016-05-23 14:28:55 +02:00
|
|
|
}
|
2017-08-01 12:33:42 +02:00
|
|
|
|
|
|
|
.row-all {
|
|
|
|
grid-row: 1 / -1;
|
2016-05-23 14:28:55 +02:00
|
|
|
}
|