aboutsummaryrefslogtreecommitdiff
path: root/scss/utilities/_spacing.scss
blob: a8d8e0afb517d2fc2f2252853294e4dd853c64c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// 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;
}