Skip to content

Instantly share code, notes, and snippets.

@jhonnymoreira
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jhonnymoreira/4c6c2a99133fb426071b to your computer and use it in GitHub Desktop.
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().
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