2014-05-04 15:48:00 +02:00
|
|
|
/* ---------------------------------- */
|
2016-09-21 10:52:49 +02:00
|
|
|
/* ==Grillade : Simple Grid System */
|
2014-05-04 15:48:00 +02:00
|
|
|
/* ---------------------------------- */
|
2016-09-21 10:52:49 +02:00
|
|
|
/* Doc : http://grillade.knacss.com */
|
2016-10-27 14:35:07 +02:00
|
|
|
// gutter values for grid layouts. Unit can be: %, px, em, rem
|
2016-10-27 15:15:38 +02:00
|
|
|
$grid-gutters: ( '': 1rem, '-l': 2rem, '-xl': 4rem );
|
|
|
|
// IEfixing, see
|
2016-10-27 14:35:07 +02:00
|
|
|
// https://github.com/alsacreations/KNACSS/issues/133;
|
|
|
|
$iefix: 0.01px;
|
2016-09-21 10:52:49 +02:00
|
|
|
@media (min-width: ($tiny + 1)) {
|
2016-10-27 14:35:07 +02:00
|
|
|
[class*=" grid-"],
|
|
|
|
[class^="grid-"] {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
2016-09-21 10:52:49 +02:00
|
|
|
& > * {
|
|
|
|
box-sizing: border-box;
|
2016-10-27 14:35:07 +02:00
|
|
|
min-width: 0;
|
|
|
|
min-height: 0;
|
2016-05-16 15:45:14 +02:00
|
|
|
}
|
2016-10-27 14:35:07 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
// Multi-line grid constructor
|
|
|
|
// example : .grid-perso { @include grid(12, 3rem); }
|
|
|
|
@mixin grid($grid-number:1, $own-gutter:0) {
|
|
|
|
& > * {
|
|
|
|
width: calc(100% / #{$grid-number} - #{$iefix});
|
|
|
|
}
|
|
|
|
@each $affix, $size in $grid-gutters {
|
|
|
|
&.has-gutter#{$affix} {
|
|
|
|
margin-right: -$size / 2;
|
|
|
|
margin-left: -$size / 2;
|
2016-09-21 10:52:49 +02:00
|
|
|
|
|
|
|
& > * {
|
2016-10-27 14:35:07 +02:00
|
|
|
width: calc(100% / #{$grid-number} - #{$size} - #{$iefix});
|
|
|
|
margin-right: $size / 2;
|
|
|
|
margin-left: $size / 2;
|
2016-09-21 10:52:49 +02:00
|
|
|
}
|
2016-04-13 23:31:11 +02:00
|
|
|
}
|
2015-07-01 13:47:48 +02:00
|
|
|
}
|
2016-10-27 14:35:07 +02:00
|
|
|
@if ($own-gutter != 0) {
|
|
|
|
margin-right: -$own-gutter / 2;
|
|
|
|
margin-left: -$own-gutter / 2;
|
2016-09-21 10:52:49 +02:00
|
|
|
|
|
|
|
& > * {
|
2016-10-27 14:35:07 +02:00
|
|
|
width: calc(100% / #{$grid-number} - #{$own-gutter} - #{$iefix});
|
|
|
|
margin-right: $own-gutter / 2;
|
|
|
|
margin-left: $own-gutter / 2;
|
2016-09-21 10:52:49 +02:00
|
|
|
}
|
2015-07-01 13:47:48 +02:00
|
|
|
}
|
2016-10-27 14:35:07 +02:00
|
|
|
}
|
|
|
|
// Mono-line grid constructor (.grid)
|
|
|
|
@media (min-width: ($tiny + 1)) {
|
|
|
|
.grid {
|
2016-09-21 10:52:49 +02:00
|
|
|
display: flex;
|
2014-05-07 11:12:14 +02:00
|
|
|
|
2016-09-21 10:52:49 +02:00
|
|
|
& > * {
|
2016-11-23 20:44:40 +01:00
|
|
|
flex: 1 1 0%;
|
2016-10-27 14:35:07 +02:00
|
|
|
box-sizing: border-box;
|
|
|
|
min-width: 0;
|
|
|
|
min-height: 0;
|
2016-09-21 10:52:49 +02:00
|
|
|
}
|
2016-10-27 14:35:07 +02:00
|
|
|
@each $affix, $size in $grid-gutters {
|
|
|
|
&.has-gutter#{$affix} > * + * {
|
|
|
|
margin-left: calc(#{$size} - #{$iefix});
|
|
|
|
}
|
2016-09-21 10:52:49 +02:00
|
|
|
}
|
2016-10-27 14:35:07 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
// Constructing grids : will be compiled in CSS
|
|
|
|
@media (min-width: ($tiny + 1)) {
|
|
|
|
@for $i from 2 through 12{
|
|
|
|
[class*="grid-#{$i}"] {
|
|
|
|
@include grid(#{$i},0);
|
2016-05-16 15:45:14 +02:00
|
|
|
}
|
|
|
|
}
|
2014-05-07 11:12:14 +02:00
|
|
|
}
|
2016-10-27 14:35:07 +02:00
|
|
|
// Grid offsets
|
2016-09-21 10:52:49 +02:00
|
|
|
.push {
|
2016-10-26 10:24:30 +02:00
|
|
|
margin-left: auto !important;
|
2016-09-21 10:52:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
.pull {
|
2016-10-26 10:24:30 +02:00
|
|
|
margin-right: auto !important;
|
2016-09-21 10:52:49 +02:00
|
|
|
}
|
2016-10-27 15:15:38 +02:00
|
|
|
// Grid order
|
2016-11-10 16:45:11 +01:00
|
|
|
.item-first {
|
2016-09-21 10:52:49 +02:00
|
|
|
order: -1;
|
|
|
|
}
|
|
|
|
|
2016-11-10 16:45:11 +01:00
|
|
|
.item-last {
|
2016-09-21 10:52:49 +02:00
|
|
|
order: 1;
|
|
|
|
}
|
2015-08-27 10:36:37 +02:00
|
|
|
|
2016-09-21 10:52:49 +02:00
|
|
|
[class*="--reverse"] {
|
|
|
|
flex-direction: row-reverse;
|
|
|
|
}
|
2016-10-27 14:35:07 +02:00
|
|
|
// sizing individual children
|
2016-09-21 10:52:49 +02:00
|
|
|
@media (min-width: ($tiny + 1)) {
|
2016-10-27 14:35:07 +02:00
|
|
|
@each $flow, $divider in ("full" "1"), ("one-half" "2"), ("one-third" "3"), ("one-quarter" "4"), ("one-fifth" "5"), ("one-sixth" "6"), ("two-thirds" "3 * 2"), ("three-quarters" "4 * 3"), ("five-sixths" "6 * 5"){
|
|
|
|
.#{$flow} {
|
|
|
|
flex: 0 0 auto;
|
|
|
|
width: calc(100% / #{$divider} - #{$iefix});
|
2016-10-26 10:24:30 +02:00
|
|
|
}
|
2016-10-27 14:35:07 +02:00
|
|
|
@each $affix, $size in $grid-gutters {
|
|
|
|
.has-gutter#{$affix} .#{$flow} {
|
|
|
|
width: calc(100% / #{$divider} - #{$size} - #{$iefix});
|
|
|
|
}
|
2016-10-26 10:24:30 +02:00
|
|
|
}
|
|
|
|
}
|
2015-08-27 10:36:37 +02:00
|
|
|
}
|
2016-09-21 10:52:49 +02:00
|
|
|
/* Responsive Small Breakpoint */
|
|
|
|
// -small-X suffix means "X columns on small screen"
|
|
|
|
// example : .grid-4-small-2 will be 1 column (tiny and down) then 2 columns (until small) then 4 columns
|
|
|
|
@media (min-width: ($tiny + 1)) and (max-width: $small) {
|
2016-10-27 14:35:07 +02:00
|
|
|
@for $i from 1 through 4{
|
|
|
|
[class*="-small-#{$i}"] {
|
|
|
|
& > * {
|
|
|
|
width: calc(100% / #{$i} - #{$iefix});
|
|
|
|
}
|
|
|
|
@each $affix, $size in $grid-gutters {
|
|
|
|
&.has-gutter#{$affix} > * {
|
|
|
|
width: calc(100% / #{$i} - #{$size} - #{$iefix});
|
|
|
|
}
|
|
|
|
}
|
2016-09-21 10:52:49 +02:00
|
|
|
}
|
|
|
|
}
|
2015-11-19 04:52:38 +01:00
|
|
|
}
|