Skip to content

Instantly share code, notes, and snippets.

@derekbtw
Last active April 23, 2017 06:47
Show Gist options
  • Save derekbtw/dd8c0f038519c94eb0b37095f68d9146 to your computer and use it in GitHub Desktop.
Save derekbtw/dd8c0f038519c94eb0b37095f68d9146 to your computer and use it in GitHub Desktop.
Creates rules "x-y" (.h-1 { height: 1px} .h-2 {height: 2px} etc.)
$total-px: 100
$rule: h-
$property: height
$px: ()
@for $i from 1 through $total-px
#{$rule}#{$i}
#{$property}: $i#{px}
// generates:
//
// .h-1 {
// height: 1px;
// }
// .h-2 {
// height: 2px;
// }
//
// etc..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment