Socket
Socket
Sign inDemoInstall

postcss-reduce-idents

Package Overview
Dependencies
Maintainers
7
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-reduce-idents

Reduce custom identifiers with PostCSS.


Version published
Weekly downloads
722K
decreased by-2.79%
Maintainers
7
Weekly downloads
 
Created

What is postcss-reduce-idents?

The postcss-reduce-idents package is a PostCSS plugin that reduces the size of CSS by minimizing identifier names. It specifically targets keyframes and counter styles, renaming them to shorter identifiers to save space.

What are postcss-reduce-idents's main functionalities?

Reduce Keyframe Identifiers

This feature reduces the length of keyframe identifiers. In the example, the keyframe name 'longAnimationName' will be shortened to a more compact identifier.

const postcss = require('postcss');
const reduceIdents = require('postcss-reduce-idents');

const css = `
@keyframes longAnimationName {
  from { opacity: 0; }
  to { opacity: 1; }
}

.element {
  animation: longAnimationName 1s;
}`;

postcss([reduceIdents()])
  .process(css, { from: undefined })
  .then(result => {
    console.log(result.css);
  });

Reduce Counter Style Identifiers

This feature reduces the length of counter style identifiers. In the example, the counter style name 'longCounterName' will be shortened to a more compact identifier.

const postcss = require('postcss');
const reduceIdents = require('postcss-reduce-idents');

const css = `
@counter-style longCounterName {
  system: numeric;
  symbols: \2022;
}

ol {
  list-style: longCounterName;
}`;

postcss([reduceIdents()])
  .process(css, { from: undefined })
  .then(result => {
    console.log(result.css);
  });

Other packages similar to postcss-reduce-idents

Keywords

FAQs

Package last updated on 06 Feb 2021

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