Skip to content

Instantly share code, notes, and snippets.

@mlbd
Created August 16, 2018 06:18
Show Gist options
  • Save mlbd/39208893c6a1de585fd095df8c449fe7 to your computer and use it in GitHub Desktop.
Save mlbd/39208893c6a1de585fd095df8c449fe7 to your computer and use it in GitHub Desktop.
$spaceamounts: ('none', 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 60, 75, 80, 100, 150); // Adjust this to include the pixel amounts you need.
$sides: (top, bottom, left, right); // Leave this variable alone
@each $space in $spaceamounts {
@each $side in $sides {
.m-#{str-slice($side, 0, 1)}-#{$space} {
@if $space == 'none' {
margin-#{$side}: 0px !important;
} @else {
margin-#{$side}: #{$space}px !important;
}
}
.p-#{str-slice($side, 0, 1)}-#{$space} {
@if $space == 'none' {
padding-#{$side}: 0px !important;
} @else {
padding-#{$side}: #{$space}px !important;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment