![]() | Name | Last modified | Size | Description |
---|---|---|---|---|
![]() | Parent Directory | - | ||
![]() | src/ | a year ago | - | |
![]() | types/ | a year ago | - | |
![]() | LICENSE-MIT | a year ago | 1.1K | |
![]() | README.md | a year ago | 1.6K | 595aea1 more query options + view options [كارل مبارك] |
![]() | package.json | a year ago | 923 | afd0ccc remove unused [كارل مبارك] |
Detect/remove browser hacks from CSS files.
With npm do:
npm install stylehacks --save
In its default mode, stylehacks will remove hacks from your CSS file, based on the browsers that you wish to support.
h1 {
_color: white;
color: rgba(255, 255, 255, 0.5);
}
h1 {
color: rgba(255, 255, 255, 0.5);
}
stylehacks.detect(node)
Type: function
Returns: boolean
This method will take any PostCSS node, run applicable plugins depending on
its type, then will return a boolean depending on whether it found any of
the supported hacks. For example, if the decl
node found below is passed to
the detect
function, it will return true
. But if the rule
node is passed,
it will return false
instead.
h1 { _color: red }
postcss([ stylehacks(opts) ])
stylehacks can also be consumed as a PostCSS plugin. See the documentation for examples for your environment.
Type: boolean
Default: false
If lint mode is enabled, stylehacks will not remove hacks from the CSS; instead,
it will add warnings to Result#messages
.
stylehacks works well with your existing PostCSS setup:
Pull requests are welcome. If you add functionality, then please add unit tests to cover it.
MIT © Ben Briggs