我将尝试类似的方法:https://stackoverflow.com/a/8380156/2309928
我有此scss代码:
10.11.12.1 - - [18/Sep/2018:19:03:03 +0200] "GET /anyWS/services/OutMessage HTTP/1.1" 500 171 0.003 3
10.11.12.1 - - [18/Sep/2018:19:03:03 +0200] "GET /anyWS/services/OutMessage?wsdl HTTP/1.1" 200 4382 0.010 10
预期的输出应如下所示:
$max-width: 95vw;
$max-height: 95vh;
$styleFactors: ("very-large": 1, "large": 0.75, "normal": 0.4, "small": 0.35);
@each $widthOrHeight in "width", "height"{
@each $style, $factor in $styleFactors {
$max-size: if($widthOrHeight == "width", $max-width, $max-height);
.#{$widthOrHeight}-#{$style} {
$style: calc(#{$max-size} * #{$factor});
}
}
}
但是没有完全没有输出,我不知道为什么会这样。
没有错误或其他任何事情
答案 0 :(得分:3)
您实际上并没有应用任何样式,只是删除了空样式。如果您在#{$widthOrHeight}: $style;
之后添加实例$style: calc(#{$max-size} * #{$factor});
,则会看到输出。
答案 1 :(得分:0)
更新了Sassmeister:
故障位于第17行:
$max-width: 95vw;
$max-height: 95vh;
$styleFactors: ("very-large": 1, "large": 0.75, "normal": 0.4, "small": 0.35);
@each $widthOrHeight in "width", "height"{
@each $style, $factor in $styleFactors {
$max-size: if($widthOrHeight == "width", $max-width, $max-height);
.#{$widthOrHeight}-#{$style} {
#{$widthOrHeight}: calc(#{$max-size} * #{$factor});
}
}
}