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
Post a Comment