PostCSS plugin to transform new RGB functions syntaxes to compatible CSS.
Find more information about these changes in "CSS Function Syntaxes (color and otherwise)" by Tab Atkins Jr.
.foo {
color: rgb(255 0 0);
}
.bar {
color: rgb(255 0 0 / 40%);
}
.baz {
color: rgba(255, 0, 0, 40%);
}
.foo {
color: rgb(255, 0, 0);
}
.bar {
color: rgba(255, 0, 0, 0.4);
}
.baz {
color: rgba(255, 0, 0, 0.4);
}
Checkout tests for more examples.
I am not able to release this code to npm because this plugin already exists and I don't want to name it postcss-color-rgb2
😒
But I couldn't remove or close this repository as long as the "official" plugin does not handle correctly complex cases #1.
postcss([ require('postcss-color-rgb') ])
See PostCSS docs for examples for your environment.