Gathering detailed insights and metrics for postcss-browser-comments-next
Gathering detailed insights and metrics for postcss-browser-comments-next
Gathering detailed insights and metrics for postcss-browser-comments-next
Gathering detailed insights and metrics for postcss-browser-comments-next
Keep only the CSS you need based on comments and your browserslist
npm install postcss-browser-comments-next
Typescript
Module System
Min. Node Version
Node Version
NPM Version
63.9
Supply Chain
99.3
Quality
75.2
Maintenance
100
Vulnerability
100
License
CSS (73.59%)
JavaScript (26.41%)
Total Downloads
1,056
Last Day
2
Last Week
11
Last Month
38
Last Year
222
CC0-1.0 License
1 Stars
9 Commits
1 Watchers
3 Branches
1 Contributors
Updated on Mar 08, 2023
Latest Version
8.0.1
Package Id
postcss-browser-comments-next@8.0.1
Unpacked Size
36.77 kB
Size
8.77 kB
File Count
8
NPM Version
7.6.2
Node Version
14.15.4
Cumulative downloads
Total Downloads
Last Day
0%
2
Compared to previous day
Last Week
37.5%
11
Compared to previous week
Last Month
123.5%
38
Compared to previous month
Last Year
82%
222
Compared to previous year
2
Forked from https://github.com/csstools/postcss-browser-comments
Packages has been forked to use devpeerapong's PostCSS 8 compatibility updates.
[PostCSS Browser Comments Next] lets you keep only the CSS you need based on comments and your browserslist.
1/** 2 * Prevent adjustments of font size after orientation changes in IE and iOS. 3 */ 4 5html { 6 -ms-text-size-adjust: 100%; 7 -webkit-text-size-adjust: 100%; 8}
The comment and rule above would be removed with the following browserslist:
1last 2 chrome versions
The rule below would be more carefully altered:
1/** 2 * 1. Add the correct box sizing in Firefox. 3 * 2. Show the overflow in Edge and IE. 4 */ 5 6hr { 7 box-sizing: content-box; /* 1 */ 8 height: 0; /* 1 */ 9 overflow: visible; /* 2 */ 10} 11 12/* with a `last 2 firefox versions` browserslist becomes */ 13 14/** 15 * 1. Add the correct box sizing in Firefox. 16 * 2. Show the overflow in Edge and IE. 17 */ 18 19hr { 20 box-sizing: content-box; /* 1 */ 21 height: 0; /* 1 */ 22}
PostCSS Browser Comments can remove rules based upon the comment above them, or it can remove declarations using numbered comments that reference the rule above them. In the later case, when all of the numbered comments are removed, then the entire rule and comment are also removed.
Add PostCSS Browser Comments to your project:
1npm install postcss postcss-browser-comments --save-dev
Use PostCSS Browser Comments to process your CSS:
1const postcssBrowserComments = require('postcss-browser-comments'); 2 3postcssBrowserComments.process(YOUR_CSS /*, processOptions, pluginOptions */);
Or use it as a PostCSS plugin:
1const postcss = require('postcss'); 2const postcssBrowserComments = require('postcss-browser-comments'); 3 4postcss([ 5 postcssBrowserComments(/* pluginOptions */) 6]).process(YOUR_CSS /*, processOptions */);
PostCSS Browser Comments runs in all Node environments, with special instructions for:
Node | PostCSS CLI | Webpack | Create React App | Gulp | Grunt |
---|
The browsers
option overrides of the project’s browserslist.
1postcssBrowserComments({
2 browsers: 'last 2 versions'
3});
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 0/9 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-04-28
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