Skip to content

Instantly share code, notes, and snippets.

@josephdburdick
Last active May 14, 2018 18:41
Show Gist options
  • Save josephdburdick/cee530498c5558204c9d23338c18ffd6 to your computer and use it in GitHub Desktop.
Save josephdburdick/cee530498c5558204c9d23338c18ffd6 to your computer and use it in GitHub Desktop.
Margin/Padding spacer utility partial
/*
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