Socket
Socket
Sign inDemoInstall

@csstools/postcss-color-mix-function

Package Overview
Dependencies
12
Maintainers
3
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @csstools/postcss-color-mix-function

Use the color-mix function in CSS


Version published
Maintainers
3
Install size
431 kB
Created

Readme

Source

PostCSS Color Mix Function PostCSS Logo

npm version Build Status Discord

Baseline Status CSS Standard Status

npm install @csstools/postcss-color-mix-function --save-dev

PostCSS Color Mix Function lets you use the color-mix() function following the CSS Color 5 Specification.

.purple_plum {
	color: color-mix(in lch, purple 50%, plum 50%);
}

/* becomes */

.purple_plum {
	color: rgb(175, 92, 174);
}

[!NOTE] We can not dynamically resolve var() arguments in color-mix(), only static values will work.

Usage

Add PostCSS Color Mix Function to your project:

npm install postcss @csstools/postcss-color-mix-function --save-dev

Use it as a PostCSS plugin:

const postcss = require('postcss');
const postcssColorMixFunction = require('@csstools/postcss-color-mix-function');

postcss([
	postcssColorMixFunction(/* pluginOptions */)
]).process(YOUR_CSS /*, processOptions */);

PostCSS Color Mix Function runs in all Node environments, with special instructions for:

Options

preserve

The preserve option determines whether the original notation is preserved. By default, it is not preserved.

postcssColorMixFunction({ preserve: true })
.purple_plum {
	color: color-mix(in lch, purple 50%, plum 50%);
}

/* becomes */

.purple_plum {
	color: rgb(175, 92, 174);
	color: color-mix(in lch, purple 50%, plum 50%);
}

Keywords

FAQs

Last updated on 04 May 2024

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc