Last active
August 29, 2015 14:17
-
-
Save jhonnymoreira/4c6c2a99133fb426071b to your computer and use it in GitHub Desktop.
Simple Stylus mixing to add shorthand (and specific) padding while converting units to 'rem' with the Kouto Swiss function rem().
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
pad(args, shorthand = true) | |
positions = top right bottom left | |
if shorthand | |
for i in (0..length(args) - 1) | |
args[i] = rem(args[i]) | |
padding: args | |
else | |
for i in (0..length(args) - 1) | |
if args[i] != 'x' | |
padding-{positions[i]}: rem(args[i]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment