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

@csstools/postcss-color-function

Package Overview
Dependencies
Maintainers
3
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@csstools/postcss-color-function

Use the color() function in CSS

  • 3.0.19
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created

What is @csstools/postcss-color-function?

@csstools/postcss-color-function is a PostCSS plugin that allows you to use color-modifying functions within your CSS. This can be particularly useful for dynamically adjusting colors, such as lightening or darkening a base color, or mixing colors together.

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

Lighten a color

This feature allows you to lighten a color by a specified percentage. In this example, the background color is lightened by 20%.

body { background-color: color(#000000 lightness(+20%)); }

Darken a color

This feature allows you to darken a color by a specified percentage. In this example, the background color is darkened by 20%.

body { background-color: color(#ffffff lightness(-20%)); }

Mix two colors

This feature allows you to blend two colors together by a specified percentage. In this example, red and blue are blended together equally to create a purple background color.

body { background-color: color(#ff0000 blend(#0000ff 50%)); }

Adjust color saturation

This feature allows you to adjust the saturation of a color. In this example, the saturation of the red color is reduced by 50%.

body { background-color: color(#ff0000 saturation(-50%)); }

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

Keywords

FAQs

Package last updated on 07 Jul 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