Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
postcss-browser-comments
Advanced tools
Keep only the CSS you need based on comments and your browserslist
npm install postcss-browser-comments --save-dev
PostCSS Browser Comments lets you keep only the CSS you need based on comments and your browserslist.
/**
* Prevent adjustments of font size after orientation changes in IE and iOS.
*/
html {
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}
/* becomes */
The comment and rule above would be removed with the following browserslist:
last 2 chrome versions
The rule below would be more carefully altered:
/**
* 1. Add the correct box sizing in Firefox.
* 2. Show the overflow in Edge and IE.
*/
hr {
box-sizing: content-box; /* 1 */
height: 0; /* 1 */
overflow: visible; /* 2 */
}
/* with a `last 2 firefox versions` browserslist becomes */
/**
* 1. Add the correct box sizing in Firefox.
* 2. Show the overflow in Edge and IE.
*/
hr {
box-sizing: content-box; /* 1 */
height: 0; /* 1 */
}
Add PostCSS Browser Comments to your project:
npm install postcss postcss-browser-comments --save-dev
Use it as a PostCSS plugin:
const postcss = require('postcss');
const postcssBrowserComments = require('postcss-browser-comments');
postcss([
postcssBrowserComments(/* pluginOptions */)
]).process(YOUR_CSS /*, processOptions */);
The browsers
option overrides of the project’s browserslist.
postcssBrowserComments({ browsers: 'last 2 versions' })
FAQs
Keep only the CSS you need based on comments and your browserslist
The npm package postcss-browser-comments receives a total of 2,430,030 weekly downloads. As such, postcss-browser-comments popularity was classified as popular.
We found that postcss-browser-comments demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.