From 5ac9fe8967c0e1797223b18954addbd179bea90e Mon Sep 17 00:00:00 2001 From: Martijn Cuppens Date: Sat, 14 Dec 2019 12:45:26 +0100 Subject: [PATCH] bootstrap-grid.css: Only apply `box-sizing: border-box` to the columns instead of using the universal selector --- scss/bootstrap-grid.scss | 10 +--------- scss/mixins/_grid.scss | 2 ++ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/scss/bootstrap-grid.scss b/scss/bootstrap-grid.scss index 8a76c9956e..4abb6822ab 100644 --- a/scss/bootstrap-grid.scss +++ b/scss/bootstrap-grid.scss @@ -5,15 +5,7 @@ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ -html { - box-sizing: border-box; -} - -*, -*::before, -*::after { - box-sizing: inherit; -} +$include-column-box-sizing: true !default; @import "functions"; @import "variables"; diff --git a/scss/mixins/_grid.scss b/scss/mixins/_grid.scss index ef97a61bfa..aa71a39a26 100644 --- a/scss/mixins/_grid.scss +++ b/scss/mixins/_grid.scss @@ -10,6 +10,8 @@ } @mixin make-col-ready($gutter: $grid-gutter-width) { + // Add box sizing if only the grid is loaded + box-sizing: if(variable-exists(include-column-box-sizing) and $include-column-box-sizing, border-box, null); // Prevent columns from becoming too narrow when at smaller grid tiers by // always setting `width: 100%;`. This works because we set the width // later on to override this initial width.