Having multiple two-class selectors for a single declaration block, is it possible to simplify the following (i.e. not having to repeat the body
tag):
In this case we can use @each
directive:
$pages: shop, contact, about, faq;
body {
@each $page in $pages {
&.#{$page} {
background-color:#FFF;
}
}
}
sassmeister.com
body {
&.shop, &.contact {
// Styles here...
}
}
try this:
body{
&.shop, &.contact, &.about, &.faq {
background-color:#fff;
}
}
If you are using sass compiled by the node, that may do.
body {
.shop, .contact, .about, .faq {
background-color:#FFFFFF;
}
}