我在注释行的可视代码中收到 [scss] }预期 [css-rcurlyexpected] 错误。有谁知道为什么吗?
@keyframes wordSlider {
$steps: -0%, -25%, -50%, -75%;
@for $index from 0 to length($steps)-1 {
$next: $index + 1;
$step: floor(100/ (length($steps)-1));
$animation_step: floor($step * 0.2);
//#{$step*$index}%,
//#{($step*$next) - $animation_step}% {
// transform: translateY(nth($steps, $index + 1));
//}
100% {
transform: translateY(nth($steps, length($steps)));
}
}
}
@keyframes wordSlider {
$steps: -0%, -25%, -50%, -75%;
@for $index from 0 to length($steps)-1 {
$next: $index + 1;
$step: floor(100/ (length($steps)-1));
$animation_step: floor($step * 0.2);
//#{$step*$index}%,
//#{($step*$next) - $animation_step}% {
// transform: translateY(nth($steps, $index + 1));}//
// Try closing your comment with ( //) //
如果您的意思是如果您取消注释行,则会发生错误,我认为 VSCode 不喜欢在
@keyframes
关键字内生成关键帧,因为它需要有效的 css 关键帧语法。
我遇到了同样的问题,可以通过用 Stylelint 验证替换 VSCode 中的本机 scss 验证来修复它。
npm i -D stylelint stylelint-config-standard-scss
{
"extends": "stylelint-config-standard-scss"
}
"scss.validate": false,
"stylelint.validate": ["css", "scss"],