| 1 | # PostCSS RebeccaPurple [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">][postcss]
|
|---|
| 2 |
|
|---|
| 3 | [<img alt="npm version" src="https://img.shields.io/npm/v/postcss-color-rebeccapurple.svg" height="20">][npm-url] [<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/rebeccapurple-color.svg" height="20">][css-url] [<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/workflows/test/badge.svg" height="20">][cli-url] [<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]
|
|---|
| 4 |
|
|---|
| 5 | [PostCSS RebeccaPurple] lets you use the `rebeccapurple` color keyword in CSS.
|
|---|
| 6 |
|
|---|
| 7 | ```pcss
|
|---|
| 8 | .heading {
|
|---|
| 9 | color: rebeccapurple;
|
|---|
| 10 | }
|
|---|
| 11 |
|
|---|
| 12 | /* becomes */
|
|---|
| 13 |
|
|---|
| 14 | .heading {
|
|---|
| 15 | color: #639;
|
|---|
| 16 | }
|
|---|
| 17 | ```
|
|---|
| 18 |
|
|---|
| 19 | ## About the `rebeccapurple` keyword
|
|---|
| 20 |
|
|---|
| 21 | In 2014, Rebecca Alison Meyer, the daughter of [Eric A. Meyer](https://en.wikipedia.org/wiki/Eric_A._Meyer), an American web design consultant best known for his advocacy work on behalf of CSS, passed away of a brain tumor at six years of age.
|
|---|
| 22 |
|
|---|
| 23 | In her memory, the hex color `#663399` is named `rebeccapurple` and [added to the CSS Colors list](https://lists.w3.org/Archives/Public/www-style/2014Jun/0312.html).
|
|---|
| 24 |
|
|---|
| 25 | ## Usage
|
|---|
| 26 |
|
|---|
| 27 | Add [PostCSS RebeccaPurple] to your project:
|
|---|
| 28 |
|
|---|
| 29 | ```bash
|
|---|
| 30 | npm install postcss postcss-color-rebeccapurple --save-dev
|
|---|
| 31 | ```
|
|---|
| 32 |
|
|---|
| 33 | Use it as a [PostCSS] plugin:
|
|---|
| 34 |
|
|---|
| 35 | ```js
|
|---|
| 36 | const postcss = require('postcss');
|
|---|
| 37 | const postcssRebeccaPurple = require('postcss-color-rebeccapurple');
|
|---|
| 38 |
|
|---|
| 39 | postcss([
|
|---|
| 40 | postcssRebeccaPurple(/* pluginOptions */)
|
|---|
| 41 | ]).process(YOUR_CSS /*, processOptions */);
|
|---|
| 42 | ```
|
|---|
| 43 |
|
|---|
| 44 | [PostCSS RebeccaPurple] runs in all Node environments, with special
|
|---|
| 45 | instructions for:
|
|---|
| 46 |
|
|---|
| 47 | | [Node](INSTALL.md#node) | [PostCSS CLI](INSTALL.md#postcss-cli) | [Webpack](INSTALL.md#webpack) | [Create React App](INSTALL.md#create-react-app) | [Gulp](INSTALL.md#gulp) | [Grunt](INSTALL.md#grunt) |
|
|---|
| 48 | | --- | --- | --- | --- | --- | --- |
|
|---|
| 49 |
|
|---|
| 50 | ## Options
|
|---|
| 51 |
|
|---|
| 52 | ### preserve
|
|---|
| 53 |
|
|---|
| 54 | The `preserve` option determines whether the original notation
|
|---|
| 55 | is preserved. By default, it is not preserved.
|
|---|
| 56 |
|
|---|
| 57 | ```js
|
|---|
| 58 | postcssRebeccaPurple({ preserve: true })
|
|---|
| 59 | ```
|
|---|
| 60 |
|
|---|
| 61 | ```pcss
|
|---|
| 62 | .heading {
|
|---|
| 63 | color: rebeccapurple;
|
|---|
| 64 | }
|
|---|
| 65 |
|
|---|
| 66 | /* becomes */
|
|---|
| 67 |
|
|---|
| 68 | .heading {
|
|---|
| 69 | color: #639;
|
|---|
| 70 | color: rebeccapurple;
|
|---|
| 71 | }
|
|---|
| 72 | ```
|
|---|
| 73 |
|
|---|
| 74 | [cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test
|
|---|
| 75 | [css-url]: https://cssdb.org/#rebeccapurple-color
|
|---|
| 76 | [discord]: https://discord.gg/bUadyRwkJS
|
|---|
| 77 | [npm-url]: https://www.npmjs.com/package/postcss-color-rebeccapurple
|
|---|
| 78 |
|
|---|
| 79 | [Gulp PostCSS]: https://github.com/postcss/gulp-postcss
|
|---|
| 80 | [Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss
|
|---|
| 81 | [PostCSS]: https://github.com/postcss/postcss
|
|---|
| 82 | [PostCSS Loader]: https://github.com/postcss/postcss-loader
|
|---|
| 83 | [PostCSS RebeccaPurple]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-rebeccapurple
|
|---|