
Security News
/Research
Fake Corepack Site Distributes Infostealer and Proxyware to Developers
A fake corepack.org site is impersonating the Node.js tool and delivers an infostealer and proxyware to developers who download it.
stylehacks
Advanced tools
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
While not exclusively focused on removing CSS hacks, PostCSS is a tool for transforming CSS with JavaScript plugins, one of which is stylehacks. PostCSS provides a broader range of functionalities for working with CSS, including autoprefixing, minification, and custom properties, making it more versatile but also more complex.
clean-css is a fast and efficient CSS optimizer that can minify CSS files, including restructuring, removing unused CSS, and applying various optimizations. While it doesn't specifically target CSS hacks like stylehacks does, it contributes to the overall goal of optimizing and cleaning CSS files.
cssnano is a modular CSS minifier that integrates with PostCSS, similar to stylehacks. It focuses on optimizing CSS files by reducing their size for production environments. cssnano includes functionalities for removing outdated browser prefixes, minifying font values, and discarding comments, among others. While it shares the goal of optimizing CSS, cssnano doesn't specifically target CSS hacks for removal but rather focuses on a wide range of optimizations.
FAQs
Detect/remove browser hacks from CSS files.
The npm package stylehacks receives a total of 14,887,830 weekly downloads. As such, stylehacks popularity was classified as popular.
We found that stylehacks demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
/Research
A fake corepack.org site is impersonating the Node.js tool and delivers an infostealer and proxyware to developers who download it.

Research
/Security News
A large-scale campaign abused GitHub Actions in compromised repositories to exploit CVE-2026-41940 in cPanel and WHM and steal server credentials.

Security News
Five frontier LLMs generated the same nonexistent package names, leaving 53 available for potential slopsquatting across PyPI and npm.