Last active
November 24, 2016 00:08
-
-
Save nicocedron/fe15bedcd45632bf59e4bc7664147a00 to your computer and use it in GitHub Desktop.
Generate margin and padding reset classes
This file contains hidden or 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
$resets: margin, padding; | |
$postfixes: top, bottom, left, right; | |
@each $reset in $resets{ | |
.reset-#{$reset}{ | |
#{$reset}: 0; | |
@each $prop in $postfixes{ | |
&-#{$prop}{ #{$reset}-#{$prop}: 0; } | |
} | |
} | |
} |
This file contains hidden or 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
.reset-margin { | |
margin: 0; | |
} | |
.reset-margin-top { | |
margin-top: 0; | |
} | |
.reset-margin-bottom { | |
margin-bottom: 0; | |
} | |
.reset-margin-left { | |
margin-left: 0; | |
} | |
.reset-margin-right { | |
margin-right: 0; | |
} | |
.reset-padding { | |
padding: 0; | |
} | |
.reset-padding-top { | |
padding-top: 0; | |
} | |
.reset-padding-bottom { | |
padding-bottom: 0; | |
} | |
.reset-padding-left { | |
padding-left: 0; | |
} | |
.reset-padding-right { | |
padding-right: 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment