Skip to content

Instantly share code, notes, and snippets.

@baconck
Last active October 12, 2017 06:56
Show Gist options
  • Save baconck/a7f8586897186d8e99fdcfad69aeb850 to your computer and use it in GitHub Desktop.
Save baconck/a7f8586897186d8e99fdcfad69aeb850 to your computer and use it in GitHub Desktop.
$spaceamounts: (5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90);
@mixin generate-margin-bottom() {
@each $space in $spaceamounts {
.mb-#{$space} {
margin-bottom: #{$space}px;
}
}
}
@mixin generate-margin-right() {
@each $space in $spaceamounts {
.mr-#{$space} {
margin-right: #{$space}px;
}
}
}
@mixin generate-margin-top() {
@each $space in $spaceamounts {
.mt-#{$space} {
margin-top: #{$space}px;
}
}
}
@mixin generate-padding-top() {
@each $space in $spaceamounts {
.pt-#{$space} {
padding-top: #{$space}px;
}
}
}
@mixin generate-padding-bottom() {
@each $space in $spaceamounts {
.pb-#{$space} {
padding-bottom: #{$space}px;
}
}
}
@include generate-margin-bottom();
@include generate-margin-right();
@include generate-margin-top();
@include generate-padding-bottom();
@include generate-padding-top();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment