Skip to content

Instantly share code, notes, and snippets.

@lanceguyatt
Last active December 10, 2015 21:18
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 lanceguyatt/4494102 to your computer and use it in GitHub Desktop.
Save lanceguyatt/4494102 to your computer and use it in GitHub Desktop.
SASS forloop example
/* @for - could really badass on lists if you needed them each to have unique styles (@while works similar) */
@for $i from 1 through 3 {
.my-class-#{$i} { width: 2px * $i; }
}
/* compiles to */
.my-class-1 {
width: 2px;
}
.my-class-2 {
width: 4px;
}
.my-cass-3 {
width: 6px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment