
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
cssnano-preset-advanced
Advanced tools
Advanced optimisations for cssnano; may or may not break your CSS!
Advanced optimisations for cssnano; may or may not break your CSS!
With npm do:
npm install cssnano-preset-advanced --save-dev
If you don't have npm then check out this installation tutorial.
If you would like to use the preset in its default configuration, specify a section in your package.json:
{
"name": "awesome-application",
+ "cssnano": {
+ "preset": "advanced"
+ }
}
But should you wish to customise this, you can pass an array with the second parameter as the options object to use. For example, to remove all comments:
{
"name": "awesome-application",
+ "cssnano": {
+ "preset": [
+ "advanced",
+ {"discardComments": {"removeAll": true}}
+ ]
+ }
}
Depending on your usage, the JSON configuration might not work for you, such as in cases where you would like to use options with customisable function parameters. For this use case, we recommend a cssnano.config.js at the same location as your package.json. You can then load a preset and export it with your custom parameters:
const advancedPreset = require('cssnano-preset-advanced');
module.exports = advancedPreset({
discardComments: {
remove: (comment) => comment[0] === '@',
},
});
Note that you may wish to publish your own preset to npm for reusability, should it differ a lot from this one. This is highly encouraged!
autoprefixer (external)Parse CSS and add vendor prefixes to CSS rules using values from the Can I Use website
This plugin is loaded with the following configuration:
{
add: false;
}
css-declaration-sorter (external)Sorts CSS declarations fast and automatically in a certain order.
This plugin is loaded with the following configuration:
{
exclude: true;
}
cssnano-utilsUtility methods used by cssnano
postcss-calc (external)PostCSS plugin to reduce calc()
This plugin is loaded with its default configuration.
postcss-colorminMinify colors in your CSS files with PostCSS.
This plugin is loaded with its default configuration.
postcss-convert-valuesConvert values with PostCSS (e.g. ms -> s)
This plugin is loaded with the following configuration:
{
length: false;
}
postcss-discard-commentsDiscard comments in your CSS files with PostCSS.
This plugin is loaded with its default configuration.
postcss-discard-duplicatesDiscard duplicate rules in your CSS files with PostCSS.
This plugin is loaded with its default configuration.
postcss-discard-emptyDiscard empty rules and values with PostCSS.
This plugin is loaded with its default configuration.
postcss-discard-overriddenPostCSS plugin to discard overridden @keyframes or @counter-style.
This plugin is loaded with its default configuration.
postcss-discard-unusedDiscard unused counter styles, keyframes and fonts.
This plugin is loaded with its default configuration.
postcss-merge-identsMerge keyframe and counter style identifiers.
This plugin is loaded with its default configuration.
postcss-merge-longhandMerge longhand properties into shorthand with PostCSS.
This plugin is loaded with its default configuration.
postcss-merge-rulesMerge CSS rules with PostCSS.
This plugin is loaded with its default configuration.
postcss-minify-font-valuesMinify font declarations with PostCSS
This plugin is loaded with its default configuration.
postcss-minify-gradientsMinify gradient parameters with PostCSS.
This plugin is loaded with its default configuration.
postcss-minify-paramsMinify at-rule params with PostCSS
This plugin is loaded with its default configuration.
postcss-minify-selectorsMinify selectors with PostCSS.
This plugin is loaded with its default configuration.
postcss-normalize-charsetAdd necessary or remove extra charset with PostCSS
This plugin is loaded with the following configuration:
{
add: false;
}
postcss-normalize-display-valuesNormalize multiple value display syntaxes into single values.
This plugin is loaded with its default configuration.
postcss-normalize-positionsNormalize keyword values for position into length values.
This plugin is loaded with its default configuration.
postcss-normalize-repeat-styleConvert two value syntax for repeat-style into one value.
This plugin is loaded with its default configuration.
postcss-normalize-stringNormalize wrapping quotes for CSS string literals.
This plugin is loaded with its default configuration.
postcss-normalize-timing-functionsNormalize CSS animation/transition timing functions.
This plugin is loaded with its default configuration.
postcss-normalize-unicodeNormalize unicode-range descriptors, and can convert to wildcard ranges.
This plugin is loaded with its default configuration.
postcss-normalize-urlNormalize URLs with PostCSS
This plugin is loaded with its default configuration.
postcss-normalize-whitespaceTrim whitespace inside and around CSS rules & declarations.
This plugin is loaded with its default configuration.
postcss-ordered-valuesEnsure values are ordered consistently in your CSS.
This plugin is loaded with its default configuration.
postcss-reduce-identsReduce custom identifiers with PostCSS.
This plugin is loaded with its default configuration.
postcss-reduce-initialReduce initial definitions to the actual initial value, where possible.
This plugin is loaded with its default configuration.
postcss-reduce-transformsReduce transform functions with PostCSS.
This plugin is loaded with its default configuration.
postcss-svgoOptimise inline SVG with PostCSS.
This plugin is loaded with the following configuration:
{
plugins: [
{
name: 'preset-default',
params: {
overrides: {
removeViewBox: false,
},
},
},
],
}
postcss-unique-selectorsEnsure CSS selectors are unique.
This plugin is loaded with its default configuration.
postcss-zindexReduce z-index values with PostCSS.
This plugin is loaded with its default configuration.
See CONTRIBUTORS.md.
MIT © Ben Briggs
FAQs
Advanced optimisations for cssnano; may or may not break your CSS!
The npm package cssnano-preset-advanced receives a total of 440,564 weekly downloads. As such, cssnano-preset-advanced popularity was classified as popular.
We found that cssnano-preset-advanced 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.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.