KNACSS/sass/components/_autogrid.scss

28 lines
658 B
SCSS
Raw Normal View History

2017-07-31 10:52:40 +02:00
/* ----------------------------- */
/* ==Autogrid object */
/* ----------------------------- */
/* recommanded HTML : <div class="autogrid">... some elements ...</div> */
2017-07-31 11:37:12 +02:00
/* see https://codepen.io/raphaelgoetter/pen/zzwxEE */
2017-07-31 10:52:40 +02:00
2017-12-04 15:48:16 +01:00
.autogrid,
.grid {
2017-08-01 21:02:01 +02:00
@media (min-width: $tiny) {
2017-07-31 11:37:12 +02:00
display: grid;
grid-auto-flow: column;
grid-auto-column: 1fr;
2017-07-31 11:37:12 +02:00
// gutters
@if variable_exists(grid-gutters) {
$gutter: $grid-gutters !global;
2016-09-21 10:26:28 +02:00
2017-07-31 11:37:12 +02:00
} @else {
$gutter: ( '': 1rem, '-l': 2rem, '-xl': 4rem ) !global;
}
@each $affix, $size in $gutter {
&.has-gutter#{$affix} {
grid-column-gap: $size;
}
}
2016-09-21 10:26:28 +02:00
}
}