@csstools/postcss-hwb-function
Use hwb() color functions in CSS
Last updated 2 years ago by alaguna .
CC0-1.0 · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install @csstools/postcss-hwb-function 
SYNC missed versions from official npm registry.

PostCSS HWB Function PostCSS Logo

npm version CSS Standard Status Build Status Discord

PostCSS HWB Function lets you use hwb color functions in CSS, following the CSS Color specification.

a {
	color: hwb(194 0% 0%);
	color: hwb(194 0% 0% / .5);
}

/* becomes */

a {
	color: rgb(0, 195, 255);
	color: rgba(0, 195, 255, .5);
}

Usage

Add PostCSS HWB Function to your project:

npm install postcss @csstools/postcss-hwb-function --save-dev

Use it as a PostCSS plugin:

const postcss = require('postcss');
const postcssHWBFunction = require('@csstools/postcss-hwb-function');

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

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

Node PostCSS CLI Webpack Gulp Grunt

Options

preserve

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

postcssHWBFunction({ preserve: true })
a {
	color: hwb(194 0% 0%);
	color: hwb(194 0% 0% / .5);
}

/* becomes */

a {
	color: rgb(0, 195, 255);
	color: hwb(194 0% 0%);
	color: rgba(0, 195, 255, .5);
	color: hwb(194 0% 0% / .5);
}

Current Tags

  • 2.2.0                                ...           latest (2 years ago)

8 Versions

  • 2.2.0                                ...           2 years ago
  • 2.1.1                                ...           2 years ago
  • 2.1.0                                ...           2 years ago
  • 2.0.1                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           3 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dev Dependencies (1)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |