忽略-webkit-box shadow和-moz-box shadow,同时在Angular中使用stylelint

发布于 2025-02-08 19:03:48 字数 1127 浏览 1 评论 0原文

如何删除CSS属性的Stylelint规则,例如-webkit-box-shadow-moz-box-shadow?因为当我运行时,它正在覆盖box-shadow - fix命令。

以下是我的.stylelintrc.json文件规则列表:

{
  "extends": "stylelint-config-recommended-scss",
  "plugins": ["stylelint-order"],
  "rules": {
    "order/properties-alphabetical-order": true,
    "at-rule-no-unknown": null,
    "no-eol-whitespace": null,
    "indentation": 2,
    "number-leading-zero": null,
    "at-rule-no-vendor-prefix": true,
    "media-feature-name-no-vendor-prefix": true,
    "property-no-vendor-prefix": true,
    "selector-no-vendor-prefix": true,
    "value-no-vendor-prefix": true,
    "string-quotes": "single",
    "at-rule-name-case": null,
    "no-invalid-position-at-import-rule": null,
    "scss/at-import-partial-extension": null,
    "no-empty-source": null,
    "no-descending-specificity": null,
    "selector-pseudo-element-no-unknown": [
      true,
      {
        "ignorePseudoElements": ["ng-deep", "input-placeholder"]
      }
    ]
  }
}

为特定css属性添加规则的任何选项吗?任何帮助将不胜感激。

How can I remove stylelint rule for CSS properties like -webkit-box-shadow and -moz-box-shadow? Because it is overwriting to box-shadow when I run --fix command.

Below is my .stylelintrc.json file rule list:

{
  "extends": "stylelint-config-recommended-scss",
  "plugins": ["stylelint-order"],
  "rules": {
    "order/properties-alphabetical-order": true,
    "at-rule-no-unknown": null,
    "no-eol-whitespace": null,
    "indentation": 2,
    "number-leading-zero": null,
    "at-rule-no-vendor-prefix": true,
    "media-feature-name-no-vendor-prefix": true,
    "property-no-vendor-prefix": true,
    "selector-no-vendor-prefix": true,
    "value-no-vendor-prefix": true,
    "string-quotes": "single",
    "at-rule-name-case": null,
    "no-invalid-position-at-import-rule": null,
    "scss/at-import-partial-extension": null,
    "no-empty-source": null,
    "no-descending-specificity": null,
    "selector-pseudo-element-no-unknown": [
      true,
      {
        "ignorePseudoElements": ["ng-deep", "input-placeholder"]
      }
    ]
  }
}

Any option to add a rule for particular CSS property? Any help will be appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不知所踪 2025-02-15 19:03:48

您可以使用 ignoreProperties 辅助选项 > property-no-dendor-prefix规则指定您不想取消修饰的属性。

例如,忽略box shadow

{
  "rules": {
    "property-no-vendor-prefix": [true, { "ignoreProperties": ["box-shadow"] }]
  }
}

You can use the ignoreProperties secondary option of the property-no-vendor-prefix rule to specify which properties you don't want to unprefix.

For example, to ignore box-shadow:

{
  "rules": {
    "property-no-vendor-prefix": [true, { "ignoreProperties": ["box-shadow"] }]
  }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文