githubEdit

PostCSS Lab Function

NPM Versionarrow-up-right CSS Standard Statusarrow-up-right Build Statusarrow-up-right Support Chatarrow-up-right

PostCSS Lab Functionarrow-up-right lets you use lab, lch, and gray color functions in CSS, following the CSS Colorarrow-up-right specification.

:root {
  --firebrick: lab(40 56.6 39);
  --firebrick-a50: lch(40 68.8 34.5 / 50%);
  --gray-40: gray(40);
  --gray-40a50: gray(40 / .5);
}

/* becomes */

:root {
  --firebrick: rgb(178, 34, 34);
  --firebrick-a50: rgba(178, 34, 34, .5);
  --gray-40: rgb(94,94,94);
  --gray-40a50: rgba(94,94,94, .5);
}

Usage

Add PostCSS Lab Functionarrow-up-right to your project:

Use PostCSS Lab Functionarrow-up-right to process your CSS:

Or use it as a PostCSSarrow-up-right plugin:

PostCSS Lab Functionarrow-up-right runs in all Node environments, with special instructions for:

Options

preserve

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

Last updated

Was this helpful?