nested scss, css

why does the nested scss not working but plain css does? working
.text-container {
&:hover {
.text-container__name {
background-color: blue;
}
}
}
.text-container {
&:hover {
.text-container__name {
background-color: blue;
}
}
}
not working
.text-container {
&:hover {
&__name {
background-color: blue;
}
}
}
.text-container {
&:hover {
&__name {
background-color: blue;
}
}
}
4 Replies
MarkBoots
MarkBoots4mo ago
the & is combining the :hover and __name .text-container:hover__name is not a valid selector
ἔρως
ἔρως4mo ago
for what you want to work, you can use this: &:hover &__name
MarkBoots
MarkBoots4mo ago
ohw, i forgot to press enter, but yes what ἔρως said
Want results from more Discord servers?
Add your server