Drahera
unread,Jan 24, 2012, 6:01:33 AM1/24/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Sass, andrew...@redbet.com, juan.ma...@redbet.com
Hi, I'm writing selectors based on a long list or names, such as
below:
@each $name in eva, maria, berit, gertrud, helga {
&.female-#{$name} { color:pink; }
}
This will generate something like this:
(context).female-eva { color:pink; }
(context).female-maria { color:pink; }
(context).female-berit { color:pink; }
and so on...
Is there a way to generate this instead?
(context).female-eva,
(context).female-maria,
(context).female-berit { color:pink; }
I've been experimenting with stuff like:
@mixin set_color($names, $color) {
@each $name in $names {
&.female-#{$name},
} {color:pink;}
}
But even if that would work in theory, the CSS last selector would end
with a comma thus being invalid. Anyone knows how to do this?
Thanks