# stylelint-postcss-map

> A stylelint custom rule to check the use of postcss-map variables on declarations

Latest version **1.0.2** (published 2016-09-10) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install stylelint-postcss-map
pnpm add stylelint-postcss-map
yarn add stylelint-postcss-map
bun add stylelint-postcss-map
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2016-09-10 |
| First published | 2016-09-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Edward Irby |
| Maintainers | edwardirby |
| Keywords | stylelint, postcss, map, variables |

## Links

- npm: https://www.npmjs.com/package/stylelint-postcss-map
- Repository: https://github.com/EdwardIrby/stylelint-postcss-map
- Homepage: https://github.com/EdwardIrby/stylelint-postcss-map#readme
- Issues: https://github.com/EdwardIrby/stylelint-postcss-map/issues
- npm.io page: https://npm.io/package/stylelint-postcss-map

## Dependencies (1)

- [stylelint](https://npm.io/package/stylelint.md) ^7.2.0

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@pandacss/eslint-plugin](https://npm.io/package/@pandacss/eslint-plugin.md) — 18.7K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2016-09-10
- 1.0.1 — 2016-09-10
- 1.0.0 — 2016-09-10

## README

# stylelint-postcss-map
---
This Stylelint plugin checks for the use of [postcss-map](https://github.com/pascalduez/postcss-map) variables in your css. It's a fork of [stylelint-declaration-use-variable](https://github.com/sh-waqar/stylelint-declaration-use-variable).

## Installation
---
```
npm install stylelint-postcss-map
```
Compatible with Stylelint v3+

## Usage
---
Add `stylelint-postcss-map` to `plugins` and `rules` array as demonstrated in the examples below.  

#### Single CSS Property
```js
//.stylelintrc
{
  "plugins": [
    "stylelint-postcss-map"
  ],
  "rules": [
    "plugin/stylelint-postcss-map": "color"
  ]
}
```

Note that your [primary option](http://stylelint.io/user-guide/configuration/#rules) must be passed in as a `nested array` for multiple CSS properties.
### Multiple CSS Properties
```js
//.stylelintrc
{
  "plugins": [
    "stylelint-postcss-map"
  ],
  "rules": [
    "plugin/stylelint-postcss-map": [["color", "width"]]
  ]
}
```

Additionally you can also configure exceptions for listed CSS properties in your rule configuration. Say for example, you don't wish to require the use of a variable for `width` values of `100%` or `100vw`.

### Single CSS Property with Exception.
```js
//.stylelintrc
{
  "plugins": [
    "stylelint-postcss-map"
  ],
  "rules": [
    "plugin/stylelint-postcss-map": [
      "width",
      {
        "width":["100%", "100vw"]
      }
    ]
  ]
}
```

You are `not required` to provide exception values for all listed CSS properties. In the example below only `color` and `width` have exceptions while `z-index` always requires a postcss-map variable.
### Multiple CSS Properties with Exceptions
```js
//.stylelintrc
{
  "plugins": [
    "stylelint-postcss-map"
  ],
  "rules": [
    "plugin/stylelint-postcss-map": [
      ["color", "width", "z-index"],
      {
        "color": ["transparent"],
        "width": ["100%", "100vw"]
      }
    ]
  ]
}
```

## Default Exceptions
---
CSS values `color()` and `calc()` are default value exceptions. If a line starts with either values the plugin will see it as valid.
```css
.foo {
  background-color: color( red a(90%));
  width: calc(2px + 2px);
}
```

---
_Source: https://npm.io/package/stylelint-postcss-map · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
