Created
November 27, 2020 11:50
-
-
Save IronGhost63/d5be586bdd817ec64ab836316783291a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Grid container. Based on Bootstrap 4. | |
* | |
* Partially works. No offset support. | |
*/ | |
.grid-container { | |
display: grid; | |
grid-template-columns: repeat($grid-columns, 1fr); | |
margin: 0 auto; | |
@for $i from 1 through $grid-columns { | |
.grid-col-#{$i} { | |
grid-column-end: span $i; | |
} | |
} | |
@each $breakpoint, $gutter in $grid-gutter-widths { | |
@include media-breakpoint-up($breakpoint) { | |
padding-left: $gutter/2; | |
padding-right: $gutter/2; | |
gap: $gutter; | |
@if map-has-key($container-max-widths, $breakpoint) { | |
$max-width: map-get($container-max-widths, $breakpoint); | |
max-width: $max-width + $gutter; | |
} | |
} | |
@for $i from 1 through $grid-columns { | |
.grid-col-#{$breakpoint}-#{$i} { | |
@include media-breakpoint-up($breakpoint) { | |
grid-column-end: span $i; | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment