想在媒体查询中更改我的变量值,但该值完全不变。为什么会这样?
我试图简单地更改媒体查询的值,但是什么也没发生。
// My variables
// All these variables works outside the media queries
$marq-width: 80vw; // using this one
$marq-height: 20vh;
$marq-elm-displayed: 5;
$marq-elements: 9;
$marq-elm-width: calc( #{$marq-width} / #{$marq-elm-displayed} );
$marq-animation-duration: calc(#{$marq-elements} * 3s);
$color: black;
$break-md: 600px;
// Here is my problem
@media(max-width: 600px) {
body {
background: red; // this works
}
$marq-width: 100vw; // this not work
}
这是我的代码笔链接:https://codepen.io/G-ROS/pen/JjPzovR?editors=0100
您可以将视口缩小为<= 600px,并看到背景变为红色,但变量完全没有变化。我希望变量更改的值为“ 100vw”,但仍保留原始值“ 80vw”。
答案 0 :(得分:1)