Deprecation Warning [mixed-decls]: Sass's behavior for declarations that appear after nested
rules will be changing to match the behavior specified by CSS in an upcoming
version. To keep the existing behavior, move the declaration above the nested
rule. To opt into the new behavior, wrap the declaration in `& {}`.
More info: https://sass-lang.com/d/mixed-decls
原因是你写了如下结构的scss:
.example {
color: red;
&--serious {
font-weight: bold;
}
font-weight: normal;
}
这样在Dart Sass < 1.77.7和 Dart Sass ≥ 1.77.7 版本会编译出不同的css。
旧版本:
.example {
color: red;
font-weight: normal;
}
.example--serious {
font-weight: bold;
}
新版本:
.example {
color: red;
}
.example--serious {
font-weight: bold;
}
.example {
font-weight: normal;
}
做这个改变的理由是与CSS的嵌套规则行为保持一致,所以请修改你的代码。
使用mixin等功能时尤其容易产生该问题,请谨慎考虑@include your-mixin在代码块中的位置。


