Answer the question
In order to leave comments, you need to log in
How to correctly write scss according to my template?
Hello, I've run into a problem.
I have a theme page, here is an example html
<div class='theme-1'>
<div class='main'>
<div class='main-child >
<div class='main-child -img></div>
</div>
</div>
</div>
.theme 1 {
.main {
&-child {
&:hover &-img {} <----
}
}
}
<element class="theme-1>
<element class="main-child" :hover>
…
<element class="main-child-img">
Answer the question
In order to leave comments, you need to log in
.main {
$this: &;
.theme_1 & {
#{$this}-child:hover #{$this}-img {
}
}
}
.main {
$this: &;
@at-root {
.theme_1 {
#{$this}-child:hover #{$this}-img {
}
}
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question