What is postcss-color-rebeccapurple?
The postcss-color-rebeccapurple package is a PostCSS plugin that allows you to use the `rebeccapurple` color keyword in your CSS, which is then transformed into the equivalent hexadecimal color code `#639`. This plugin is part of the PostCSS ecosystem, which is a tool for transforming CSS with JavaScript plugins.
What are postcss-color-rebeccapurple's main functionalities?
Transform `rebeccapurple` keyword to hexadecimal
This code demonstrates how you can use the `rebeccapurple` keyword in your CSS. When processed by postcss-color-rebeccapurple, it will be transformed into the hexadecimal color `#639`.
css
.post {
color: rebeccapurple;
}
Other packages similar to postcss-color-rebeccapurple
postcss-color-gray
Similar to postcss-color-rebeccapurple, postcss-color-gray is a PostCSS plugin that allows you to use the `gray()` function in your CSS. It transforms this function into a compatible color format.
postcss-color-hex-alpha
This plugin extends CSS by allowing you to use hexadecimal notation with alpha channels for color definitions. It's similar to postcss-color-rebeccapurple in that it provides additional color definition options in CSS.
postcss-color-function
postcss-color-function is a plugin that processes CSS color functions based on the CSS Color Module Level 4 specification. It's more general than postcss-color-rebeccapurple, offering a wider range of color manipulation features.
postcss-color-rebeccapurple
PostCSS plugin to transform W3C CSS rebeccapurple
color to more compatible CSS (rgb()).
Installation
$ npm install postcss-color-rebeccapurple
Usage
var fs = require("fs")
var postcss = require("postcss")
var colorRebeccapurple = require("postcss-color-rebeccapurple")
var css = fs.readFileSync("input.css", "utf8")
var output = postcss()
.use(colorRebeccapurple())
.process(css)
.css
Using this input.css
:
body {
color: rebeccapurple
}
you will get:
body {
color: rgb(102, 51, 153);
}
Checkout tests for more examples.
Contributing
Work on a branch, install dev-dependencies, respect coding style & run tests before submitting a bug fix or a feature.
$ git clone https://github.com/postcss/postcss-color-rebeccapurple.git
$ git checkout -b patch-1
$ npm install
$ npm test