sass - SCSS Intermediate Selector "Or" -
i couldn't find on docs have selector this:
.a > .b > .c, .a > .d > .c { color: red } as can see i'm practically repeating whole selector. there like:
.a > (.b, .d) > .c { color: red } or prevents repeating majority of selector? must use mixin?
your proposed pseudo code works. need turn scss syntax. so:
.a{ > .b, > .d{ > .c{ color: red; } } } make use of scss nesting properties ;)
edit: in reference mixin idea.
you can technically turn mixin. question have ask is, common structure using throughout site? if going repeat same a-b-c, a-d-c specificity path lot changing color, yes, turn mixin($color:$argument) , use $argument pass color needed $color variable
@mixin changing-color($color){ color: $color; } .a{ > .b, > .d{ > .c{ @include changing-color(red); } } }
Comments
Post a Comment