aboutsummaryrefslogtreecommitdiff
path: root/scss/_grid.scss
diff options
context:
space:
mode:
authorMartijn Cuppens <[email protected]>2019-09-28 16:13:36 +0200
committerMartijn Cuppens <[email protected]>2020-03-10 20:30:29 +0100
commitbeefc6f53062f735f4d2d829305a8a502d12795d (patch)
treeeb07a730678fa0b47923b49616f0d753cc8223b6 /scss/_grid.scss
parent0327545e6dbe1f0c22d909dd4c94d88050e5159a (diff)
downloadbootstrap-beefc6f53062f735f4d2d829305a8a502d12795d.tar.xz
bootstrap-beefc6f53062f735f4d2d829305a8a502d12795d.zip
Bootstrap 5 grid
Diffstat (limited to 'scss/_grid.scss')
-rw-r--r--scss/_grid.scss44
1 files changed, 35 insertions, 9 deletions
diff --git a/scss/_grid.scss b/scss/_grid.scss
index 8bcb419e1..e4e3c9796 100644
--- a/scss/_grid.scss
+++ b/scss/_grid.scss
@@ -5,18 +5,44 @@
@if $enable-grid-classes {
.row {
@include make-row();
+
+ > * {
+ @include make-col-ready();
+ }
}
+}
+
+// Gutters
+//
+// Make use of `.g-*`, `.gx-*` or `.gy-*` utilities to change spacing between the columns.
+
+@if $enable-grid-classes {
+ @each $breakpoint in map-keys($grid-breakpoints) {
+ $infix: breakpoint-infix($breakpoint, $grid-breakpoints);
+
+ @include media-breakpoint-up($breakpoint, $grid-breakpoints) {
+
+ @each $key, $value in $gutters {
+ .g#{$infix}-#{$key},
+ .gx#{$infix}-#{$key} {
+ margin-right: -$value / 2;
+ margin-left: -$value / 2;
+
+ > * {
+ padding-right: $value / 2;
+ padding-left: $value / 2;
+ }
+ }
- // Remove the negative margin from default .row, then the horizontal padding
- // from all immediate children columns (to prevent runaway style inheritance).
- .no-gutters {
- margin-right: 0;
- margin-left: 0;
+ .g#{$infix}-#{$key},
+ .gy#{$infix}-#{$key} {
+ margin-top: -$value;
- > .col,
- > [class*="col-"] {
- padding-right: 0;
- padding-left: 0;
+ > * {
+ margin-top: $value;
+ }
+ }
+ }
}
}
}