Last active
May 14, 2018 18:41
-
-
Save josephdburdick/cee530498c5558204c9d23338c18ffd6 to your computer and use it in GitHub Desktop.
Margin/Padding spacer utility partial
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Margin & Padding spacers | |
usage: mt-4 -> margin-top: 4rem; | |
*/ | |
$spacer: 1rem; | |
$sizes: 0, 1, 2, 3, 4, 5, 6; | |
$directions: top, left, bottom, right; | |
@each $direction in $directions{ | |
@each $size in $sizes{ | |
.m#{str-slice($direction, 1, 1)}-#{$size} { | |
margin-#{$direction}: #{$size * $spacer}!important; | |
} | |
.p#{str-slice($direction, 1, 1)}-#{$size} { | |
padding-#{$direction}: #{$size * $spacer}!important; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment