Skip to content

Instantly share code, notes, and snippets.

@nicocedron
Last active November 24, 2016 00:08
Show Gist options
  • Save nicocedron/fe15bedcd45632bf59e4bc7664147a00 to your computer and use it in GitHub Desktop.
Save nicocedron/fe15bedcd45632bf59e4bc7664147a00 to your computer and use it in GitHub Desktop.
Generate margin and padding reset classes
$resets: margin, padding;
$postfixes: top, bottom, left, right;
@each $reset in $resets{
.reset-#{$reset}{
#{$reset}: 0;
@each $prop in $postfixes{
&-#{$prop}{ #{$reset}-#{$prop}: 0; }
}
}
}
.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