0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-12-01 13:24:25 +01:00

Use variables for the width/height classes

This commit is contained in:
Starsam80 2016-12-25 15:29:01 -07:00 committed by Mark Otto
parent 210050d9c9
commit c2e5eb1542
2 changed files with 12 additions and 9 deletions

View File

@ -169,6 +169,13 @@ $spacers: (
) !default; ) !default;
$border-width: 1px !default; $border-width: 1px !default;
// This variable affects the `.h-*` and `.w-*` classes.
$sizes: (
25: 25%,
50: 50%,
75: 75%,
100: 100%
) !default;
// Body // Body
// //

View File

@ -1,14 +1,10 @@
// Width and height // Width and height
.w-25 { width: 25% !important; } @each $prop, $abbrev in (width: w, height: h) {
.w-50 { width: 50% !important; } @each $size, $length in $sizes {
.w-75 { width: 75% !important; } .#{$abbrev}-#{$size} { #{$prop}: $length !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; }
.mw-100 { max-width: 100% !important; } .mw-100 { max-width: 100% !important; }
.mh-100 { max-height: 100% !important; } .mh-100 { max-height: 100% !important; }