Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

postcss-color-functional-notation

Package Overview
Dependencies
Maintainers
3
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-color-functional-notation

Use space and slash separated color notation in CSS

  • 7.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2M
decreased by-62.01%
Maintainers
3
Weekly downloads
 
Created

What is postcss-color-functional-notation?

The postcss-color-functional-notation package is a PostCSS plugin that transforms CSS color functions like `rgb()`, `rgba()`, `hsl()`, `hsla()`, `hwb()`, and `lab()` into a more modern and consistent functional notation. This helps in maintaining a consistent color format across your stylesheets and ensures compatibility with modern CSS standards.

What are postcss-color-functional-notation's main functionalities?

Transforming RGB/RGBA Notation

This feature transforms the traditional `rgb()` and `rgba()` functions into the modern space-separated notation. This makes the color definitions more consistent and easier to read.

/* Input CSS */
body {
  color: rgb(255, 0, 0);
  background-color: rgba(0, 255, 0, 0.5);
}

/* Output CSS */
body {
  color: rgb(255 0 0);
  background-color: rgb(0 255 0 / 0.5);
}

Transforming HSL/HSLA Notation

This feature converts the `hsl()` and `hsla()` functions into the modern space-separated notation, making the color definitions more consistent and easier to read.

/* Input CSS */
body {
  color: hsl(120, 100%, 50%);
  background-color: hsla(240, 100%, 50%, 0.5);
}

/* Output CSS */
body {
  color: hsl(120 100% 50%);
  background-color: hsl(240 100% 50% / 0.5);
}

Transforming HWB Notation

This feature transforms the `hwb()` function into the modern space-separated notation, ensuring consistency and readability in color definitions.

/* Input CSS */
body {
  color: hwb(120, 0%, 0%);
}

/* Output CSS */
body {
  color: hwb(120 0% 0%);
}

Transforming LAB Notation

This feature converts the `lab()` function into the modern space-separated notation, making the color definitions more consistent and easier to read.

/* Input CSS */
body {
  color: lab(50, 0, 0);
}

/* Output CSS */
body {
  color: lab(50 0 0);
}

Other packages similar to postcss-color-functional-notation

Keywords

FAQs

Package last updated on 14 Aug 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc