1. postcss-color-hwb
PostCSS plugin to transform W3C CSS hwb() color to more compatible CSS (rgb() (or rgba()))
postcss-color-hwb
Package: postcss-color-hwb
Created by: postcss
Last modified: Fri, 24 Jun 2022 09:39:10 GMT
Version: 3.0.0
License: MIT
Downloads: 590,073
Repository: https://github.com/postcss/postcss-color-hwb

Install

npm install postcss-color-hwb
yarn add postcss-color-hwb

postcss-color-hwb Build Status

PostCSS plugin to transform W3C CSS hwb() color to more compatible CSS (rgb() (or rgba())).

Installation

 $ npm install postcss-color-hwb

Usage

 // dependencies
var fs = require("fs")
var postcss = require("postcss")
var colorHwb = require("postcss-color-hwb")

// css to be processed
var css = fs.readFileSync("input.css", "utf8")

// process css
var output = postcss()
  .use(colorHwb())
  .process(css)
  .css

Using this input.css:

 body {
  color: hwb(90, 0%, 0%, 0.5);
}

you will get:

 body {
  color: rgba(128, 255, 0, 0.5);
}

Checkout tests for more examples.


Contributing

Work on a branch, install dev-dependencies, respect coding style & run tests before submitting a bug fix or a feature.

$ git clone https://github.com/postcss/postcss-color-hwb.git
$ git checkout -b patch-1
$ npm install
$ npm test

Changelog

License

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code