Skip to content

Instantly share code, notes, and snippets.

@rub1cc
Created August 5, 2018 15:16
Show Gist options
  • Save rub1cc/ac6cff62e5aa583b505d943869b875cb to your computer and use it in GitHub Desktop.
Save rub1cc/ac6cff62e5aa583b505d943869b875cb to your computer and use it in GitHub Desktop.
Padding and Margin Helper (SASS)
$spaceamounts: (5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100);
$sides: (top, bottom, left, right);
@each $space in $spaceamounts {
@each $side in $sides {
.m#{str-slice($side, 0, 1)}-#{$space} {
margin-#{$side}: #{$space}px;
}
.p#{str-slice($side, 0, 1)}-#{$space} {
padding-#{$side}: #{$space}px;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment