Answer the question
In order to leave comments, you need to log in
How to correctly write nesting in scss?
Hello. There is a record like
select {
/* when select open add class OPEN */
&.open {
z-index: 2;
.select__dropdown {
display: block;
background-color: white;
}
.select__label {
border-bottom: none;
}
.select__arrow {
transition: 0.3s ease;
transform: rotate(180deg);
}
}
}
Answer the question
In order to leave comments, you need to log in
you can make a variable and just substitute it
$self: "select";
.#{$self} {
&.open {
z-index: 2;
.#{$self}__dropdown {
display: block;
background-color: white;
}
.#{$self}__label {
border-bottom: none;
}
.#{$self}__arrow {
transition: 0.3s ease;
transform: rotate(180deg);
}
}
}
.select {
&.open {
z-index: 2;
}
&.open &__dropdown {
display: block;
background-color: white;
}
&.open &__label {
border-bottom: none;
}
&.open &__arrow {
transition: 0.3s ease;
transform: rotate(180deg);
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question