Answer the question
In order to leave comments, you need to log in
How to use the & character to select the parent element? Or how to choose the parent element?
The question itself lies in the problem of the symbol & as such. there is a mixin excerpt
@mixin ResponsiveImage($type) {
@if type == content {
max-width: 100%;
height: auto;
} @else if type == row {
& {
// Here
}
width: 100%;
height: 100%;
object-fit: cover;
position: absolute;
top: 0;
left: 0;
}
}
Answer the question
In order to leave comments, you need to log in
Understood, if anyone needs it.
@mixin ResponsiveImage($type, $ParentClass, $ChildClass) {
@if type == content {
max-width: 100%;
height: auto;
} @else if type == row {
.#{$ParentClass} {
padding: 0px 0px 60% 0px;
overflow: hidden;
position: relative;
}
.#{$ChildClass} {
width: 100%;
height: 100%;
object-fit: cover;
position: absolute;
top: 0;
left: 0;
}
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question