This is what I prefer. Define a mixin like body-style
:
@mixin body-style($style, $map) {
body.#{$style} & {
@each $property, $value in $map {
#{$property}: $value;
}
}
}
Then use this for every tag by passing $style as style class of body and $map as map of css keys and values.
a {
@include body-style(style1, (
color: red,
background: white
)
);
}
It will return :
body.style1 a {
color: red;
background: white;
}