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

postcss-colormin

Package Overview
Dependencies
Maintainers
7
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-colormin

Minify colors in your CSS files with PostCSS.

  • 4.0.0-nightly.2020.10.20
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.4M
decreased by-57.53%
Maintainers
7
Weekly downloads
 
Created

What is postcss-colormin?

The postcss-colormin package is a PostCSS plugin designed to optimize color values within your CSS. It reduces the size of color values and converts them into more efficient formats when possible, contributing to smaller CSS file sizes and potentially faster load times for web pages.

What are postcss-colormin's main functionalities?

Minifying color values

This feature takes a CSS string with color values and uses the colormin plugin to minimize the color values. For example, it can convert '#ff0000' to 'red', which is shorter.

"const postcss = require('postcss');
const colormin = require('postcss-colormin');

postcss([colormin()]).process('a { color: #ff0000; }').then(result => {
  console.log(result.css); // Output: 'a { color: red; }'
});"

Converting RGBA to hex when possible

This feature optimizes RGBA color values to their hex or named color equivalent when the alpha value is 1, thus reducing the size of the CSS.

"const postcss = require('postcss');
const colormin = require('postcss-colormin');

postcss([colormin()]).process('a { background-color: rgba(255, 0, 0, 1); }').then(result => {
  console.log(result.css); // Output: 'a { background-color: red; }'
});"

Other packages similar to postcss-colormin

Keywords

FAQs

Package last updated on 20 Oct 2020

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