Skip to content

Instantly share code, notes, and snippets.

@srsgores
Created August 19, 2014 21:23
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 srsgores/f1b9e63d957f84c2843f to your computer and use it in GitHub Desktop.
Save srsgores/f1b9e63d957f84c2843f to your computer and use it in GitHub Desktop.
Stylus Dynamic Placeholders
properties = margin padding
proportions = mini small normal medium large
directions = top left bottom right
$smallmargintop = 1.3em
for property in properties
for proportion, i in proportions
for direction in directions
define("$" + proportion + property + direction, unit(i / 3, "em")) // $small-margin-top = ...
${proportion}-{property}-{direction} // $small-margin-top
{property}-{direction} lookup("$" + proportion + property + direction) // margin-top $marginlargetop
body
@extend $small-margin-top
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment