📅 You're Invited: Meet the Socket team at RSAC (April 28 – May 1).RSVP

@csstools/postcss-oklab-function

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@csstools/postcss-oklab-function

Use oklab() and oklch() color functions in CSS

4.0.9
latest
Version published
Weekly downloads
4.1M
0.3%
Maintainers
3
Weekly downloads
 
Created

What is @csstools/postcss-oklab-function?

@csstools/postcss-oklab-function is a PostCSS plugin that allows you to use the OKLab color function in your CSS. OKLab is a color space designed to be perceptually uniform, meaning that the perceived difference between colors is consistent across the entire color space. This plugin enables you to write colors in the OKLab color space and have them converted to a more widely supported format.

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

Using OKLab color function

This feature allows you to write colors using the OKLab color function in your CSS. The plugin will convert these colors to a more widely supported format, such as RGB.

/* Input CSS */
body {
  color: oklab(59.69% 0.072 -0.236);
}

/* Output CSS */
body {
  color: rgb(255, 0, 0);
}

Custom properties with OKLab

This feature allows you to define custom properties using the OKLab color function. The plugin will convert these custom properties to a more widely supported format.

/* Input CSS */
:root {
  --primary-color: oklab(59.69% 0.072 -0.236);
}

body {
  color: var(--primary-color);
}

/* Output CSS */
:root {
  --primary-color: rgb(255, 0, 0);
}

body {
  color: var(--primary-color);
}

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

FAQs

Package last updated on 19 Apr 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