_spacing.scss
78 lines
| 1 | // Margin and Padding |
| 2 | |
| 3 | @each $breakpoint in map-keys($grid-breakpoints) { |
| 4 | @include media-breakpoint-up($breakpoint) { |
| 5 | $infix: breakpoint-infix($breakpoint, $grid-breakpoints); |
| 6 | |
| 7 | @each $prop, $abbrev in (margin: m, padding: p) { |
| 8 | @each $size, $length in $grid-spacers { |
| 9 | .evf-#{$abbrev}#{$infix}-#{$size} { |
| 10 | #{$prop}: $length !important; |
| 11 | } |
| 12 | .evf-#{$abbrev}t#{$infix}-#{$size}, |
| 13 | .evf-#{$abbrev}y#{$infix}-#{$size} { |
| 14 | #{$prop}-top: $length !important; |
| 15 | } |
| 16 | .evf-#{$abbrev}r#{$infix}-#{$size}, |
| 17 | .evf-#{$abbrev}x#{$infix}-#{$size} { |
| 18 | #{$prop}-right: $length !important; |
| 19 | } |
| 20 | .evf-#{$abbrev}b#{$infix}-#{$size}, |
| 21 | .evf-#{$abbrev}y#{$infix}-#{$size} { |
| 22 | #{$prop}-bottom: $length !important; |
| 23 | } |
| 24 | .evf-#{$abbrev}l#{$infix}-#{$size}, |
| 25 | .evf-#{$abbrev}x#{$infix}-#{$size} { |
| 26 | #{$prop}-left: $length !important; |
| 27 | } |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | // Negative margins (e.g., where `.evf-mb-n1` is negative version of `.evf-mb-1`) |
| 32 | @each $size, $length in $grid-spacers { |
| 33 | @if $size != 0 { |
| 34 | .evf-m#{$infix}-n#{$size} { |
| 35 | margin: -$length !important; |
| 36 | } |
| 37 | .evf-mt#{$infix}-n#{$size}, |
| 38 | .evf-my#{$infix}-n#{$size} { |
| 39 | margin-top: -$length !important; |
| 40 | } |
| 41 | .evf-mr#{$infix}-n#{$size}, |
| 42 | .evf-mx#{$infix}-n#{$size} { |
| 43 | margin-right: -$length !important; |
| 44 | } |
| 45 | .evf-mb#{$infix}-n#{$size}, |
| 46 | .evf-my#{$infix}-n#{$size} { |
| 47 | margin-bottom: -$length !important; |
| 48 | } |
| 49 | .evf-ml#{$infix}-n#{$size}, |
| 50 | .evf-mx#{$infix}-n#{$size} { |
| 51 | margin-left: -$length !important; |
| 52 | } |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | // Some special margin utils |
| 57 | .evf-m#{$infix}-auto { |
| 58 | margin: auto !important; |
| 59 | } |
| 60 | .evf-mt#{$infix}-auto, |
| 61 | .evf-my#{$infix}-auto { |
| 62 | margin-top: auto !important; |
| 63 | } |
| 64 | .evf-mr#{$infix}-auto, |
| 65 | .evf-mx#{$infix}-auto { |
| 66 | margin-right: auto !important; |
| 67 | } |
| 68 | .evf-mb#{$infix}-auto, |
| 69 | .evf-my#{$infix}-auto { |
| 70 | margin-bottom: auto !important; |
| 71 | } |
| 72 | .evf-ml#{$infix}-auto, |
| 73 | .evf-mx#{$infix}-auto { |
| 74 | margin-left: auto !important; |
| 75 | } |
| 76 | } |
| 77 | } |
| 78 |