Merge pull request #289 from ml-uni/master

Add columns number variable
This commit is contained in:
Raphael Goetter 2018-09-25 11:06:23 +02:00 committed by GitHub
commit a85af1ee32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 5 deletions

View file

@ -79,6 +79,9 @@ $hyphens: false !default;
// Spacing zone
// ------------
// Number of grid-columns
$cols: 12;
// Grid gutters (for .has-gutter-* classes)
$grid-gutters: (
'': 1rem,

View file

@ -84,7 +84,7 @@ $iefix: 0.01px;
}
// Constructing grids : will be compiled in CSS
@media (min-width: $small) {
@for $i from 2 through 12 {
@for $i from 2 through $cols {
[class*="grid-#{$i}"] {
@include grid(#{$i}, 0);
}

View file

@ -56,15 +56,15 @@ $medium: 768px !default;
}
}
// grid constructor (.grid-2 to .grid-12)
@for $i from 2 through 12 {
// grid constructor (.grid-2 to .grid-$cols)
@for $i from 2 through $cols {
[class*="grid-#{$i}"] {
grid-template-columns: repeat(#{$i}, 1fr);
}
}
// grid items constructor (.col-1 to .col-12, .row-1 to .row-12)
@for $i from 1 through 12 {
// grid items constructor (.col-1 to .col-$cols, .row-1 to .row-$cols)
@for $i from 1 through $cols {
[class*="col-#{$i}"] {
grid-column: auto / span #{$i};
}