Answer the question
In order to leave comments, you need to log in
How to use scss variable in calc?
Hello, please tell me why this code does not compile correctly
div {
$item-margin: 1vmin;
width: calc(50vw - $item-margin * 2);
height: calc(50vw - $item-margin * 2);
background: red;
}
div {
width: calc(50vw - $item-margin * 2);
height: calc(50vw - $item-margin * 2);
background: red;
}
Answer the question
In order to leave comments, you need to log in
div {
$item-margin: 1vmin;
width: calc(50vw - #{$item-margin} * 2);
height: calc(50vw - #{$item-margin} * 2);
background: red;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question