Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
postcss-discard-empty
Advanced tools
Package description
The postcss-discard-empty npm package is a PostCSS plugin that is used to remove empty rules, selectors, and at-rules from your CSS. This helps in reducing the size of the CSS file and cleaning up any unused or empty CSS declarations that may be left over after development or refactoring.
Discard empty rules
This feature removes CSS rules that have no declarations inside them. For example, 'a{}' would be removed from the CSS because it's an empty rule.
postcss([ require('postcss-discard-empty') ]).process('a{}').css
Discard empty at-rules
This feature removes at-rules that have no content. For example, '@media screen {}' would be removed because it contains no rules or declarations.
postcss([ require('postcss-discard-empty') ]).process('@media screen {}').css
Discard empty selectors
This feature removes selectors that have no declarations. In the given code, 'b{}' would be removed, leaving only the selector 'a' with its declaration.
postcss([ require('postcss-discard-empty') ]).process('a{ color: red; } b{}').css
cssnano is a modular minifier that includes functionalities to discard empty rules among other optimizations. It is more comprehensive than postcss-discard-empty as it performs a wide range of optimizations to reduce CSS size.
postcss-cleanup is another PostCSS plugin that can remove unused and duplicate code from CSS files, including empty rules. It provides a broader set of features for cleaning up CSS files compared to postcss-discard-empty.
purgecss is a tool to remove unused CSS, which can also result in the removal of empty rules if they become empty after purging unused styles. It differs from postcss-discard-empty by focusing on removing unused selectors rather than just empty ones.
Readme
Discard empty rules and values with PostCSS.
With npm do:
npm install postcss-discard-empty --save
For more examples see the tests.
@font-face;
h1 {}
{color:blue}
h2 {color:}
h3 {color:red}
h3 {color:red}
See the PostCSS documentation for examples for your environment.
See CONTRIBUTORS.md.
MIT © Ben Briggs
FAQs
Discard empty rules and values with PostCSS.
The npm package postcss-discard-empty receives a total of 10,237,300 weekly downloads. As such, postcss-discard-empty popularity was classified as popular.
We found that postcss-discard-empty demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.