Stylelint plugin for stylehacks linting.
npm install stylelint-no-browser-hackscss
h1 { _color: white; }
/** ↑
Hacks like this /
`
If you are uncertain what "browser hacks" are, ["An Introduction to
Browser-Specific Hacks"][sitepoint-browser-specific-css-hacks]
explains it well.
This rule uses [stylehacks] to detect the hacks. Then, in the spirit of
stylelint, it tells you that you've done something wrong. If instead you would
like to automatically remove browser hacks, use [stylehacks] directly.
[stylehacks] is only compatible with standard CSS syntax, and does not support
nested properties nor custom property sets.
Bugs and feature requests should be reported on the
[stylehacks issue tracker][stylehacks-issues].
Installation
`
npm install stylelint-no-browser-hacks
`
Usage
Add stylelint-no-browser-hacks to your stylelint config plugins array, then
add rules you need to the rules list.
Note that the rule is namespaced with plugin/.
Like so:
`json
// .stylelintrc
{
"plugins": [
"stylelint-no-browser-hacks"
],
"rules": {
// ...
"plugin/no-browser-hacks": [true],
// ...
}
}
`
Options
$3
Defaults to the browserslist default, which targets modern browsers.
The following patterns are considered warnings:
`css
a { color/\*/: pink\9; }
``