Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cssnano-preset-default

Package Overview
Dependencies
Maintainers
7
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cssnano-preset-default

Safe defaults for cssnano which require minimal configuration.

  • 6.1.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
7
Created

What is cssnano-preset-default?

The cssnano-preset-default package is a default preset for cssnano, which is a modular minifier for CSS. It includes various optimizations that are safe to use without breaking the CSS. This preset is a collection of default optimizations that can be applied to CSS files to reduce their size and improve loading times in production environments.

What are cssnano-preset-default's main functionalities?

Minification

This feature allows you to minify CSS, removing whitespace and comments, and optimizing CSS code to reduce file size.

"use strict";const cssnano=require('cssnano');const presetDefault=require('cssnano-preset-default');const postcss=require('postcss');postcss([cssnano({preset:presetDefault()})]).process('.example { color: #ffffff; }').then(result => {console.log(result.css);});

Rebasing z-index values

This feature rebases z-index values to a smaller range to reduce file size without affecting the stacking order of elements.

"use strict";const cssnano=require('cssnano');const presetDefault=require('cssnano-preset-default');const postcss=require('postcss');postcss([cssnano({preset:presetDefault()})]).process('.z1 { z-index: 1000; } .z2 { z-index: 2000; }').then(result => {console.log(result.css);});

Reducing CSS calc expressions

This feature optimizes CSS calc expressions by reducing them to their smallest form.

"use strict";const cssnano=require('cssnano');const presetDefault=require('cssnano-preset-default');const postcss=require('postcss');postcss([cssnano({preset:presetDefault()})]).process('h1 { margin-top: calc(10px + 20px); }').then(result => {console.log(result.css);});

Merging duplicate rules

This feature merges duplicate CSS rules into one to reduce file size and redundancy.

"use strict";const cssnano=require('cssnano');const presetDefault=require('cssnano-preset-default');const postcss=require('postcss');postcss([cssnano({preset:presetDefault()})]).process('.example { color: red; } .example { color: red; }').then(result => {console.log(result.css);});

Other packages similar to cssnano-preset-default

FAQs

Package last updated on 06 Mar 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc