Repository navigation
|
Hi! Is there a Vite or PostCSS setting/plugin that can warn me when I use a CSS rule not supported by the target browsers (e.g. specified in the |
Replies: 1 comment
|
Vite does not currently have a built-in Browserslist-based CSS compatibility lint. For warnings, run Stylelint separately with npm add -D stylelint stylelint-no-unsupported-browser-features{
"plugins": ["stylelint-no-unsupported-browser-features"],
"rules": {
"plugin/no-unsupported-browser-features": [
true,
{ "severity": "warning" }
]
}
}The rule uses the project's Sources: Vite |
Vite does not currently have a built-in Browserslist-based CSS compatibility lint.
build.cssTargetcontrols CSS output/minification transformations; it is not an authoring-time compatibility checker.For warnings, run Stylelint separately with
stylelint-no-unsupported-browser-features:{ "plugins": ["stylelint-no-unsupported-browser-features"], "rules": { "plugin/no-unsupported-browser-features": [ true, { "severity": "warning" } ] } }The rule uses the project's
browserslistconfiguration automatically. It is best kept at warning severity because it cannot detect whether you supplied a fallback.Sour…