I want to dynamically create mixins in SASS, named after each item in the list, but it doesn't seem to work.
I tried this but I get an error:
$event-icons: fair, concert, art-show, conference, dance-show, film, party, festival, theatre, launch
@each $event-icon in $event-icons
@mixin event-icon-#{$event-icon}
background-position: -($event-icon-width * $i) 0
Error:
Invalid CSS after "": expected expression (e.g. 1px, bold), was "#{$event-icon}"
Is this usage not supported by SASS? I couldn't find anything in the manual about it.
See Question&Answers more detail:os