sass - Is there a way to use the & on the same line as the parent selector? -


this question has answer here:

what trying apply same styles button's default state focused state. this, way more 1 line of styling:

.my-button {     color: red;     &:focus: {         color: red;     } } 

in order avoid having duplicate styling, i'm hoping can write like:

.my-button, &:focus {     color: red; } 

but of course that's not how & works. there way this?

i know write .my-button, .my-button:focus { ... }. i'm trying learn if possible sass.

you use parent selector on own, &, &:focus:

.my-button {     &, &:focus {         color: red;     } } 

Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -