Answer the question
In order to leave comments, you need to log in
How to make class name inheritance in SCSS?
Good evening! Faced such a problem.
I have this css file:
.menu { ... }
.menu .menu-list { ... }
.menu .menu-list .menu-list-item { ... }
.menu .menu-list .menu-list-item:hover { ... }
.menu {
...
& &-list {
....
& &-item {
....
&:hover {
....
}
}
}
}
.menu { ... }
.menu .menu-list { ... }
.menu .menu-list .menu .menu-list-item { ... }
Answer the question
In order to leave comments, you need to log in
you need to translate someone else's code into scss. Or are there any alternatives?
.menu {
...
.menu-list {
...
.menu-list-item {
...
&:hover {
...
}
}
}
}
.menu{...}
.menu .menu-list{...}
.menu .menu-list .menu-list-item{...}
.menu .menu-list .menu-list-item:hover{...}
It turns out some kind of tin
.menu {
color: red;
.menu {
&-list {
color: green;
.menu-list {
&-item {
color: blacl;
&:hover {
color: orange;
}
}
}
}
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question