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

@csstools/postcss-color-mix-function

Package Overview
Dependencies
Maintainers
3
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@csstools/postcss-color-mix-function

Use the color-mix function in CSS

  • 2.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.1M
decreased by-5.28%
Maintainers
3
Weekly downloads
 
Created

What is @csstools/postcss-color-mix-function?

@csstools/postcss-color-mix-function is a PostCSS plugin that allows you to use the CSS `color-mix()` function in your stylesheets. This function enables you to mix two colors together, which can be useful for creating color themes, gradients, and other visual effects.

What are @csstools/postcss-color-mix-function's main functionalities?

Mixing Two Colors

This feature allows you to mix two colors together using the `color-mix()` function. In this example, red and blue are mixed in equal proportions to produce a purple color.

/* Input CSS */
.example {
  color: color-mix(in srgb, red 50%, blue);
}

/* Output CSS */
.example {
  color: #800080;
}

Mixing Colors with Different Percentages

This feature allows you to specify different percentages for each color in the mix. In this example, red is given a 70% weight and blue a 30% weight, resulting in a reddish-purple color.

/* Input CSS */
.example {
  color: color-mix(in srgb, red 70%, blue 30%);
}

/* Output CSS */
.example {
  color: #b3004d;
}

Using Different Color Spaces

This feature allows you to mix colors in different color spaces. In this example, the colors are mixed in the LCH color space, which can produce different results compared to the default sRGB color space.

/* Input CSS */
.example {
  color: color-mix(in lch, red 50%, blue);
}

/* Output CSS */
.example {
  color: #a2007d;
}

Other packages similar to @csstools/postcss-color-mix-function

Keywords

FAQs

Package last updated on 18 Sep 2023

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