css - LESS add class with pseudo selector -
i use less , here example:
.arrow{ color: red; } .arrow:before{ content: ">"; } .button{ background: blue; .arrow; &:before{ border: 1px solid; } }
and css after parsing:
.button{ background: blue; color: red; } .button:before{ border: 1px solid; // here no content: ">" !!! }
how add :before styles .arrow class button?
you can use extend
option below. applies properties of arrow
class button
class also. all
keyword means child classes extended.
less:
.button{ background: blue; &:extend(.arrow all); &:before{ border: 1px solid; } }
compiled css:
.arrow, .button { color: red; } .arrow:before, .button:before { content: ">"; }
Comments
Post a Comment