Multiple two-class selectors in Sass

Issue

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):

body.shop, body.contact, body.about, body.faq {background-color:#fff;}

Solution

try this:

body{
   &.shop, &.contact, &.about, &.faq {
        background-color:#fff;
    }
}

Answered By – Alessandro Minoccheri

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published