You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@csstools/postcss-hwb-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-hwb-function

Use hwb() color functions in CSS

4.0.8
Source
npmnpm
Version published
Weekly downloads
4.7M
2.04%
Maintainers
3
Weekly downloads
 
Created

What is @csstools/postcss-hwb-function?

@csstools/postcss-hwb-function is a PostCSS plugin that allows you to use the HWB (Hue, Whiteness, Blackness) color function in your CSS. This function is part of the CSS Color Module Level 4 specification and provides an alternative way to define colors, which can be more intuitive for certain use cases.

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

Using HWB color function

This feature allows you to use the HWB color function in your CSS. The plugin will transform the HWB function into an equivalent RGB value.

/* Input CSS */
.example {
  color: hwb(90 0% 0%);
}

/* Output CSS */
.example {
  color: rgb(128, 255, 0);
}

Custom properties with HWB

You can define custom properties using the HWB function, and the plugin will convert these to RGB values, allowing you to use them throughout your CSS.

/* Input CSS */
:root {
  --main-color: hwb(200 30% 40%);
}
.example {
  color: var(--main-color);
}

/* Output CSS */
:root {
  --main-color: rgb(77, 102, 153);
}
.example {
  color: var(--main-color);
}

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

Keywords

color

FAQs

Package last updated on 23 Feb 2025

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.