Last active
July 6, 2017 19:40
-
-
Save bardouni/be8588be095e426e7ae99dcae6881f05 to your computer and use it in GitHub Desktop.
Generate margin/padding helper 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
$unit: px | |
$points: 0,5,10 | |
@each $abbrs, $s in (-i:!important, '':'') | |
@each $pabbr, $p in (m:margin, p:padding) | |
@each $size in $points | |
@each $abbr,$name in (t:-top, b:-bottom, l:-left, r:-right, a:'') | |
.#{$pabbr}#{$abbr}-#{$size}#{$abbrs} | |
#{$p}#{$name}: $size#{$unit} #{$s} | |
@each $abbr, $a1, $a2 in (v,top,bottom),(h,left,right) | |
.#{$pabbr}#{$abbr}-#{$size}#{$abbrs} | |
#{$p}-#{$a1}: $size#{$unit} #{$s} | |
#{$p}-#{$a2}: $size#{$unit} #{$s} | |
// the Results : | |
.mt-0 { | |
margin-top: 0px; | |
} | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment