Last active
May 17, 2016 22:10
-
-
Save defo550/18dce2ed75180a5ae00b8d889c47466f to your computer and use it in GitHub Desktop.
Generate a series of rulesets that adjust either padding/margin.
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
._pan, ._ptn, ._pvn { | |
padding-top: 0 !important; | |
} | |
._pan, ._prn, ._phn { | |
padding-right: 0 !important; | |
} | |
._pan, ._pbn, ._pvn { | |
padding-bottom: 0 !important; | |
} | |
._pan, ._pln, ._phn { | |
padding-left: 0 !important; | |
} | |
._pas, ._pts, ._pvs { | |
padding-top: 6px !important; | |
} | |
._pas, ._prs, ._phs { | |
padding-right: 6px !important; | |
} | |
._pas, ._pbs, ._pvs { | |
padding-bottom: 6px !important; | |
} | |
._pas, ._pls, ._phs { | |
padding-left: 6px !important; | |
} | |
._pam, ._ptm, ._pvm { | |
padding-top: 12px !important; | |
} | |
._pam, ._prm, ._phm { | |
padding-right: 12px !important; | |
} | |
._pam, ._pbm, ._pvm { | |
padding-bottom: 12px !important; | |
} | |
._pam, ._plm, ._phm { | |
padding-left: 12px !important; | |
} | |
._pal, ._ptl, ._pvl { | |
padding-top: 24px !important; | |
} | |
._pal, ._prl, ._phl { | |
padding-right: 24px !important; | |
} | |
._pal, ._pbl, ._pvl { | |
padding-bottom: 24px !important; | |
} | |
._pal, ._pll, ._phl { | |
padding-left: 24px !important; | |
} |
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
// ---- | |
// libsass (v3.3.6) | |
// ---- | |
$spacing: ( | |
n: 0, | |
s: (24px / 4), | |
m: (24px * 0.5), | |
l: 24px | |
) !default; | |
@each $prop, $abbrev in (padding: p) { | |
@each $size, $length in $spacing { | |
%#{$abbrev}#{$size}-top { #{$prop}-top: $length !important; } | |
%#{$abbrev}#{$size}-right { #{$prop}-right: $length !important; } | |
%#{$abbrev}#{$size}-bottom { #{$prop}-bottom: $length !important; } | |
%#{$abbrev}#{$size}-left { #{$prop}-left: $length !important } | |
._#{$abbrev}a#{$size} { | |
@extend %#{$abbrev}#{$size}-top; | |
@extend %#{$abbrev}#{$size}-right; | |
@extend %#{$abbrev}#{$size}-bottom; | |
@extend %#{$abbrev}#{$size}-left; | |
} | |
._#{$abbrev}t#{$size} { @extend %#{$abbrev}#{$size}-top; } | |
._#{$abbrev}r#{$size} { @extend %#{$abbrev}#{$size}-right; } | |
._#{$abbrev}b#{$size} { @extend %#{$abbrev}#{$size}-bottom; } | |
._#{$abbrev}l#{$size} { @extend %#{$abbrev}#{$size}-left; } | |
// Axes | |
._#{$abbrev}h#{$size} { | |
@extend %#{$abbrev}#{$size}-left; | |
@extend %#{$abbrev}#{$size}-right; | |
} | |
._#{$abbrev}v#{$size} { | |
@extend %#{$abbrev}#{$size}-bottom; | |
@extend %#{$abbrev}#{$size}-top; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment