Gathering detailed insights and metrics for stylehacks
Gathering detailed insights and metrics for stylehacks
Gathering detailed insights and metrics for stylehacks
Gathering detailed insights and metrics for stylehacks
A modular minifier, built on top of the PostCSS ecosystem.
npm install stylehacks
Typescript
Module System
Min. Node Version
Node Version
NPM Version
95.4
Supply Chain
97.5
Quality
91.2
Maintenance
100
Vulnerability
100
License
CSS (77.38%)
JavaScript (22.16%)
Nunjucks (0.46%)
Total Downloads
2,578,155,343
Last Day
1,815,398
Last Week
11,300,515
Last Month
47,045,442
Last Year
538,942,127
MIT License
4,856 Stars
2,554 Commits
320 Forks
48 Watchers
43 Branches
111 Contributors
Updated on May 10, 2025
Minified
Minified + Gzipped
Latest Version
7.0.5
Package Id
stylehacks@7.0.5
Unpacked Size
37.92 kB
Size
9.34 kB
File Count
66
NPM Version
10.8.2
Node Version
20.19.1
Published on
May 06, 2025
Cumulative downloads
Total Downloads
Last Day
17.2%
1,815,398
Compared to previous day
Last Week
11.1%
11,300,515
Compared to previous week
Last Month
-5.6%
47,045,442
Compared to previous month
Last Year
3.6%
538,942,127
Compared to previous year
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.
1h1 { 2 _color: white; 3 color: rgba(255, 255, 255, 0.5); 4}
1h1 { 2 color: rgba(255, 255, 255, 0.5); 3}
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.
1h1 { _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
No vulnerabilities found.
Reason
13 commit(s) and 2 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
GitHub workflow tokens follow principle of least privilege
Details
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
packaging workflow detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 8
Details
Reason
2 existing vulnerabilities detected
Details
Reason
Found 4/22 approved changesets -- score normalized to 1
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Score
Last Scanned on 2025-05-05
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More