Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
postcss-normalize-whitespace
Advanced tools
Trim whitespace inside and around CSS rules & declarations.
The postcss-normalize-whitespace npm package is a PostCSS plugin designed to normalize and minimize the whitespace in your CSS. It helps in reducing the file size and improving the readability of the CSS by consistently formatting the whitespace.
Minifying CSS
This feature allows you to compress your CSS by removing unnecessary whitespace, which can include spaces, tabs, and newlines that are not required for the CSS to function properly.
const postcss = require('postcss');
const normalizeWhitespace = require('postcss-normalize-whitespace');
postcss([normalizeWhitespace]).process('h1 { color: red; }').then(result => {
console.log(result.css); // Output: 'h1{color:red}'
});
cssnano is a modular minifier that includes various optimizations, including whitespace normalization. It is more comprehensive than postcss-normalize-whitespace as it provides a wide range of optimizations beyond just whitespace normalization.
clean-css is another powerful CSS minifier that offers advanced optimizations. It can perform many transformations to reduce CSS size, including whitespace normalization. It is similar to cssnano in its broad scope of features.
uglifycss is a simple tool for CSS minification that also includes whitespace normalization. It is less modular than cssnano and focuses on providing a straightforward solution for CSS compression.
Normalize whitespace with PostCSS.
With npm do:
npm install postcss-normalize-whitespace --save
h1{
width: calc(10px - ( 100px / var(--test) ))
}
h1{
width: calc(10px - 100px / var(--test))
}
See the PostCSS documentation for examples for your environment.
See CONTRIBUTORS.md.
MIT © Ben Briggs
FAQs
Trim whitespace inside and around CSS rules & declarations.
The npm package postcss-normalize-whitespace receives a total of 8,467,864 weekly downloads. As such, postcss-normalize-whitespace popularity was classified as popular.
We found that postcss-normalize-whitespace 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
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.