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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -