Answer the question
In order to leave comments, you need to log in
How to go up a level in sass?
There is a style structure like this:
.block {
&__text {
...
}
&__title {
...
}
}
.block {
&--open {
.block--text {
...
}
}
&__text {
...
}
&__title {
...
}
}
Answer the question
In order to leave comments, you need to log in
The variable $this.
A typical problem when creating self-controlled components (especially when using the BEM methodology) is creating selectors inside modifiers.
Instead of:
.filter-block {
&__title {
color: black;
}
&--expandable {
.filter-block__title {
color: blue;
}
}
}
.filter-block {
$this: &;
&__title {
color: black;
}
&--expandable {
#{$this}__title {
color: blue;
}
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question