EdMSL / postcss-color-converter

PostCSS plugin to convert colors between HEX, RGB, HSL and keyword color formats.
MIT License
7 stars 1 forks source link

Support modern color function notation #18

Closed daanvosdewael closed 3 weeks ago

daanvosdewael commented 1 month ago

When using the plug-in with modern color function notation, the conversion is not correct. An example with rgb() to hsl() with alpha:

// Input
body {
  background-color: rgb(255 255 255 / 0);
}

// Output
body {
  background-color: hsla(60, 100%, 50%, 1);
}

// Expected
body {
  background-color: hsl(0 0% 100% / 0);
}

More info about the notation can be found in the spec: https://drafts.csswg.org/css-color/#the-hsl-notation

EdMSL commented 1 month ago

I'll see what I can do.

EdMSL commented 1 month ago

Fixed in 1.1.1.