html - Avoid double writing styles -


i know how can avoid writing styles twice if same element , it's possible pseudo classes:

.element {   color: #a0c225;   &:hover {     color: #a0c225;   }   &:focus {     color: #a0c225;   } } 

and don't want repeat color #a0c225 in sass?

you use & this:

.element {     &, &:hover, &:focus {         color: #a0c225;     } } 

which compile to:

.element, .element:hover, .element:focus {     color: #a0c225; } 

Comments

Popular posts from this blog

android - How to save instance state of selected radiobutton on menu -

python 3 IndexError: list index out of range -

IF statement in MySQL trigger -