PostCSS plugin to transform W3C CSS Color Module Level 4 rgb() new syntax to more compatible CSS (comma-separated rgb() or rgba())
npm install postcss-color-rgb[PostCSS] plugin to transform W3C CSS Color Module Level 4 rgb() new syntax to more compatible CSS (comma-separated rgb() or rgba()).
[PostCSS]: https://github.com/postcss/postcss
[ci-img]: https://travis-ci.org/dmarchena/postcss-color-rgb.svg
[ci]: https://travis-ci.org/dmarchena/postcss-color-rgb
[cov-img]: https://coveralls.io/repos/github/dmarchena/postcss-color-rgb/badge.svg
[cov]: https://coveralls.io/github/dmarchena/postcss-color-rgb
``
rgb() = rgb(
rgb(
`
`
rgb() = rgb(
rgb(
rgba() = rgba(
rgba(
`
`css`
.foo {
/ Input example /
color: rgb(250.5 255 255);
background-image: linear-gradient(to bottom right, rgb(10% 11% 12% / 90%), rgb(23% 24% 25% / .5));
}
`css`
.foo {
/ Output example /
color: rgb(251, 255, 255);
background-image: linear-gradient(to bottom right, rgba(10%, 11%, 12%, .9), rgba(23%, 24%, 25%, .5));
}
`js``
postcss([ require('postcss-color-rgb') ])
See [PostCSS] docs for examples for your environment.