Skip to content

PostCSS plugin to transform new RGB functions syntaxes to compatible CSS.

License

Notifications You must be signed in to change notification settings

7studio/postcss-color-rgb

Repository files navigation

PostCSS Color Rgb Build Status

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.

Installation

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.

Usage

postcss([ require('postcss-color-rgb') ])

See PostCSS docs for examples for your environment.

About

PostCSS plugin to transform new RGB functions syntaxes to compatible CSS.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published