0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-11-29 11:24:18 +01:00
Bootstrap/scss/utilities/_spacing.scss
Starsam80 b226766b62 Remove lots of duplication + minor cleanup (#21238)
* Remove comment that duplicated some code
* Use transition mixin whenever possible
* Create a new function to reduce duplication
* Use the new `breakpoint-infix` method
2016-11-28 13:23:59 -08:00

52 lines
1.4 KiB
SCSS

// Width and height
.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }
.mw-100 { max-width: 100% !important; }
.mh-100 { max-height: 100% !important; }
// Margin and Padding
.mx-auto {
margin-right: auto !important;
margin-left: auto !important;
}
@each $breakpoint in map-keys($grid-breakpoints) {
@each $prop, $abbrev in (margin: m, padding: p) {
@each $size, $lengths in $spacers {
$length-x: map-get($lengths, x);
$length-y: map-get($lengths, y);
@include media-breakpoint-up($breakpoint) {
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
.#{$abbrev}#{$infix}-#{$size} { #{$prop}: $length-y $length-x !important; }
.#{$abbrev}t#{$infix}-#{$size} { #{$prop}-top: $length-y !important; }
.#{$abbrev}r#{$infix}-#{$size} { #{$prop}-right: $length-x !important; }
.#{$abbrev}b#{$infix}-#{$size} { #{$prop}-bottom: $length-y !important; }
.#{$abbrev}l#{$infix}-#{$size} { #{$prop}-left: $length-x !important; }
.#{$abbrev}x#{$infix}-#{$size} {
#{$prop}-right: $length-x !important;
#{$prop}-left: $length-x !important;
}
.#{$abbrev}y#{$infix}-#{$size} {
#{$prop}-top: $length-y !important;
#{$prop}-bottom: $length-y !important;
}
}
}
}
}
// Positioning
.pos-f-t {
position: fixed;
top: 0;
right: 0;
left: 0;
z-index: $zindex-navbar-fixed;
}