Skip to content

Instantly share code, notes, and snippets.

@Christilut
Created January 7, 2019 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Christilut/ca418de3e04ef1bc5d6ccb30164088df to your computer and use it in GitHub Desktop.
Save Christilut/ca418de3e04ef1bc5d6ccb30164088df to your computer and use it in GitHub Desktop.
$g: 20px;
$props: (
(margin, ma),
(margin-top, mt),
(margin-bottom, mb),
(margin-left, ml),
(margin-right, mr),
(padding, pa),
(padding-top, pt),
(padding-bottom, pb),
(padding-left, pl),
(padding-right, pr)
);
@mixin generateLayoutHelpers($proplist) {
@each $prop, $className in $proplist {
.#{$className} {
#{$prop}: $g;
}
.#{$className}-s {
#{$prop}: $g / 4;
}
.#{$className}-m {
#{$prop}: $g / 2;
}
}
}
@include generateLayoutHelpers($props);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment