Created
November 3, 2017 16:10
-
-
Save Momciloo/1037e732c2452b10cc6890423293c57a to your computer and use it in GitHub Desktop.
Common Spacings 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
/* | |
# ================================================================= | |
# Spacings | |
# ================================================================= | |
usage: | |
.u-mt_4 | |
.u-pb_0 | |
.u-p_64 | |
*/ | |
$spacings: 0,2,4,8,16,32,64,96; | |
$properties: (margin, m), | |
(padding, p); | |
$sides: (top, t), | |
(right, r), | |
(bottom, b), | |
(left, l); | |
@each $space in $spacings { | |
@each $property, $property_short in $properties { | |
.u-#{$property_short} { #{$property}: $space + px + '!important'; } | |
@each $side, $side_short in $sides { | |
.u-#{$property_short}#{$side_short}_#{$space}{ | |
#{$property}-#{$side}: $space + px + '!important'; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment