# PostCSS Gray

[![NPM Version](https://img.shields.io/npm/v/postcss-color-gray.svg)](https://www.npmjs.com/package/postcss-color-gray) [![CSS Standard Status](https://cssdb.org/badge/gray-function.svg)](https://cssdb.org/#gray-function) [![Build Status](https://img.shields.io/travis/postcss/postcss-color-gray.svg)](https://travis-ci.org/postcss/postcss-color-gray) [![Support Chat](https://img.shields.io/badge/support-chat-blue.svg)](https://gitter.im/postcss/postcss)

[PostCSS Gray](https://github.com/postcss/postcss-color-gray) lets you use the `gray()` color function in CSS, following the [CSSWG Specification](https://drafts.csswg.org/css-color/#grays).

```
body {
  background-color: gray(100);
  color: gray(0 / 90%);
}

/* becomes */

body {
  background-color: rgb(255,255,255);
  color: rgba(0,0,0,.9);
}
```

## Usage

Add [PostCSS Gray](https://github.com/postcss/postcss-color-gray) to your project:

```bash
npm install postcss-color-gray --save-dev
```

Use [PostCSS Gray](https://github.com/postcss/postcss-color-gray) to process your CSS:

```js
import postcssGray from 'postcss-color-gray';

postcssGray.process(YOUR_CSS /*, processOptions, pluginOptions */);
```

Or use it as a [PostCSS](https://github.com/postcss/postcss) plugin:

```js
import postcss from 'postcss';
import postcssGray from 'postcss-color-gray';

postcss([
  postcssGray(/* pluginOptions */)
]).process(YOUR_CSS /*, processOptions */);
```

[PostCSS Gray](https://github.com/postcss/postcss-color-gray) runs in all Node environments, with special instructions for:

| [Node](https://github.com/bgoonz/Learning-Redux/blob/master/repos/examples/real-world/node_modules/postcss-color-gray/INSTALL.md#node) | [Webpack](https://github.com/bgoonz/Learning-Redux/blob/master/repos/examples/real-world/node_modules/postcss-color-gray/INSTALL.md#webpack) | [Create React App](https://github.com/bgoonz/Learning-Redux/blob/master/repos/examples/real-world/node_modules/postcss-color-gray/INSTALL.md#create-react-app) | [Gulp](https://github.com/bgoonz/Learning-Redux/blob/master/repos/examples/real-world/node_modules/postcss-color-gray/INSTALL.md#gulp) | [Grunt](https://github.com/bgoonz/Learning-Redux/blob/master/repos/examples/real-world/node_modules/postcss-color-gray/INSTALL.md#grunt) |
| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |

## Options

### preserve

The `preserve` option determines whether the original `gray()` function should be preserved or replaced. By default, the `gray()` function is replaced.

By setting `preserve` to `true`, the original `gray()` function is preserved.

```js
postcssGray({ preserve: true });
```

```
body {
  background-color: gray(100);
  color: gray(0 / 90%);
}

/* becomes */

body {
  background-color: gray(100);
  background-color: rgb(255,255,255);
  color: gray(0 / 90%);
  color: rgba(0,0,0,.9);
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://bryan-guner.gitbook.io/my-docs/redux/repos/examples/real-world/node_modules/postcss-color-gray.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
