Skip to content

Instantly share code, notes, and snippets.

@jbuedel
Created November 6, 2012 18:56
Show Gist options
  • Save jbuedel/4026713 to your computer and use it in GitHub Desktop.
Save jbuedel/4026713 to your computer and use it in GitHub Desktop.
A loop in sass
$marginDirections: left, right, bottom, top;
$marginValues: 10, 20, 30, 40, 50, 60;
@for $marginDirection from 1 through length($marginDirections) {
@for $marginValue from 1 through length($marginValues) {
.add-#{$marginDirection}-#{$marginValue} {
margin-#{$marginDirection}: #{$marginValue}px;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment