如何满足 stylelint“上下文”检查,而不导致 gulp 错误?

问题描述 投票:0回答:1

我的代码:

@media (min-width: 965px) {
    #my-class {
        justify-content: flex-end;
    }
}

导致 stylelint 抛出此错误:

✖  Expected "context" media feature      media-feature-range-notation
             range notation

我尝试了他们的建议:

 @media (width >= 965px) {

但这只会导致 gulp 抛出此错误:

Error: unclosed parenthesis in media query expression
sass gulp-sass stylelint
1个回答
0
投票

像“@media (min-width: 965px) {”这样的查询是一种较旧的方法。 “@media (width >= 965px) {”是指定相同查询的较新方法。 我们的代码库仍然需要 node-sass,但它不再受支持。更新我们的 gulpfile.js 以使用“sass”而不是“node-sass”似乎可以解决 gulp 错误。

© www.soinside.com 2019 - 2024. All rights reserved.