Created
August 19, 2014 21:23
-
-
Save srsgores/f1b9e63d957f84c2843f to your computer and use it in GitHub Desktop.
Stylus Dynamic Placeholders
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
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