Socket
Socket
Sign inDemoInstall

postcss-lab-function

Package Overview
Dependencies
5
Maintainers
2
Versions
44
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    postcss-lab-function

Use lab() and lch() color functions in CSS


Version published
Maintainers
2
Created

Readme

Source

PostCSS Lab Function PostCSS Logo

npm version CSS Standard Status Build Status support chat

PostCSS Lab Function lets you use lab and lch color functions in CSS, following the CSS Color specification.

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

/* becomes */

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

Usage

Add PostCSS Lab Function to your project:

npm install postcss postcss-lab-function --save-dev

Use it as a PostCSS plugin:

const postcss = require('postcss');
const postcssLabFunction = require('postcss-lab-function');

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

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

NodePostCSS CLIWebpackCreate React AppGulpGrunt

Options

preserve

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

postcssLabFunction({ preserve: true })
:root {
  --firebrick: lab(40% 56.6 39);
  --firebrick-a50: lch(40% 68.8 34.5 / 50%);
}

/* becomes */

:root {
  --firebrick: rgb(178, 34, 34);
  --firebrick: lab(40% 56.6 39);
  --firebrick-a50: rgba(178, 34, 34, .5);
  --firebrick-a50: lch(40% 68.8 34.5 / 50%);
}

Keywords

FAQs

Last updated on 13 Dec 2021

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc