diff options
| author | Starsam80 <[email protected]> | 2016-12-25 15:29:01 -0700 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2016-12-25 15:32:34 -0800 |
| commit | c2e5eb154275f10c38d903af1cc069bce501a932 (patch) | |
| tree | c0c5867a65672abcd5e1765df9bebd90601d3a2a | |
| parent | 210050d9c9ad24cc206a71a5f3dad5b77f23c5e6 (diff) | |
| download | bootstrap-c2e5eb154275f10c38d903af1cc069bce501a932.tar.xz bootstrap-c2e5eb154275f10c38d903af1cc069bce501a932.zip | |
Use variables for the width/height classes
| -rw-r--r-- | scss/_variables.scss | 7 | ||||
| -rw-r--r-- | scss/utilities/_spacing.scss | 14 |
2 files changed, 12 insertions, 9 deletions
diff --git a/scss/_variables.scss b/scss/_variables.scss index d7f5f4c68..f1132999a 100644 --- a/scss/_variables.scss +++ b/scss/_variables.scss @@ -169,6 +169,13 @@ $spacers: ( ) !default; $border-width: 1px !default; +// This variable affects the `.h-*` and `.w-*` classes. +$sizes: ( + 25: 25%, + 50: 50%, + 75: 75%, + 100: 100% +) !default; // Body // diff --git a/scss/utilities/_spacing.scss b/scss/utilities/_spacing.scss index c1b3747b6..208212d52 100644 --- a/scss/utilities/_spacing.scss +++ b/scss/utilities/_spacing.scss @@ -1,14 +1,10 @@ // Width and height -.w-25 { width: 25% !important; } -.w-50 { width: 50% !important; } -.w-75 { width: 75% !important; } -.w-100 { width: 100% !important; } - -.h-25 { height: 25% !important; } -.h-50 { height: 50% !important; } -.h-75 { height: 75% !important; } -.h-100 { height: 100% !important; } +@each $prop, $abbrev in (width: w, height: h) { + @each $size, $length in $sizes { + .#{$abbrev}-#{$size} { #{$prop}: $length !important; } + } +} .mw-100 { max-width: 100% !important; } .mh-100 { max-height: 100% !important; } |
