Answer the question
In order to leave comments, you need to log in
Why is @media not copied to css?
Hello, please tell me why this code is not working
<!DOCTYPE html>
<body>
<div class="frame"></div>
</body>
</html>
.frame {
@mixin superVar($var, $number, $vh, $vw) {
@media (min-aspect-ratio: 2/1) {
$var: $number * $vh;
}
@media (max-aspect-ratio: 2/1) {
$var: $number * $vw;
}
}
@include superVar("--superVmin", 1, 2, 1);
width: calc(10 * var(--superVmin));
height: 10vmin;
background: red;
}
Answer the question
In order to leave comments, you need to log in
@mixin superVar($var, $number, $vh, $vw) {
@media (min-aspect-ratio: 2/1) {
#{$var}: $number * $vh;
}
@media (max-aspect-ratio: 2/1) {
#{$var}: $number * $vw;
}
}
.frame {
@include superVar(--superVmin, 1, 2vh, 1vw);
width: calc(10 * var(--superVmin));
height: 10vmin;
background: red;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question