Skip to content

Instantly share code, notes, and snippets.

@ebello
Created March 15, 2013 15:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ebello/5170467 to your computer and use it in GitHub Desktop.
Save ebello/5170467 to your computer and use it in GitHub Desktop.
Dynamic extend-only selectors
@for $i from 0 through 6 {
%row#{$i} {
top: $block-size * $i;
}
}
@each $year in 1997, 1994, 1993, 1991 {
#y#{$year} a {
@extend %row3;
}
}
@ebello
Copy link
Author

ebello commented Mar 15, 2013

With $block-size set to 118px, it compiles to:

#y1997 a, #y1994 a, #y1993 a, #y1991 a {
  top: 354px;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment