Answer the question
In order to leave comments, you need to log in
How to set a variable directly to several classes in scss?
Hey! I need to put a direct block of properties into one variable:
#front-hello {
padding: 20vh 0 1vh;
.front-hello-slider {
position: relative;
top: -1.5vw;
.slider-vertical-item {
margin-bottom: 2.3vw;
}
img {
width: 53px;
}
}
}
Answer the question
In order to leave comments, you need to log in
learn to ask questions. based on the comment under the answer Sergey : maybe like this?
@mixin my-mixin($classname, $anotherClassname) {
padding: 20vh 0 1vh;
#{$classname} {
position: relative;
top: -1.5vw;
#{$anotherClassname} {
margin-bottom: 2.3vw;
}
img {
width: 53px;
}
}
}
#front-hello {
@include my-mixin('.front-hello-slider','.slider-vertical-item');
}
#back-hello {
@include my-mixin('.back-hello-slider','.slider-vertical-item');
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question