Last active
August 4, 2021 07:41
-
-
Save luisramirezdev/5c422ef9c09fbdf00e76b191f1f6da69 to your computer and use it in GitHub Desktop.
Margin and padding space class generator like Bootstrap (Utility Classes)
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
$spacer: 8px; | |
$spaces: ( | |
0: 0, | |
1: ( | |
$spacer | |
), | |
2: ( | |
$spacer * 2 | |
), | |
3: ( | |
$spacer * 3 | |
), | |
4: ( | |
$spacer * 4 | |
), | |
5: ( | |
$spacer * 5 | |
), | |
6: ( | |
$spacer * 6 | |
) | |
); | |
$sides: (top, bottom, left, right); | |
@each $key, $space in $spaces { | |
@each $side in $sides { | |
.m#{str-slice($side, 0, 1)}-#{$key} { | |
margin-#{$side}: #{$space} !important; | |
} | |
.p#{str-slice($side, 0, 1)}-#{$key} { | |
padding-#{$side}: #{$space} !important; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment