Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ierhyna/stylelint-no-indistinguishable-colors
Stylelint plugin to add rule no-indistinguishable-colors
https://github.com/ierhyna/stylelint-no-indistinguishable-colors
stylelint stylelint-plugin
Last synced: 8 days ago
JSON representation
Stylelint plugin to add rule no-indistinguishable-colors
- Host: GitHub
- URL: https://github.com/ierhyna/stylelint-no-indistinguishable-colors
- Owner: ierhyna
- Created: 2018-06-13T14:23:18.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-01-31T12:23:03.000Z (10 months ago)
- Last Synced: 2024-09-19T09:41:54.346Z (about 2 months ago)
- Topics: stylelint, stylelint-plugin
- Language: JavaScript
- Size: 1.68 MB
- Stars: 18
- Watchers: 1
- Forks: 8
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# stylelint-no-indistinguishable-colors
[![NPM Version](https://img.shields.io/npm/v/stylelint-no-indistinguishable-colors.svg)](https://www.npmjs.com/package/stylelint-no-indistinguishable-colors)
[Stylelint](http://stylelint.io) plugin that disallows colors that are suspiciously close to being identical, using [css-colorguard](https://github.com/SlexAxton/css-colorguard).
## Installation
```
npm install --save-dev stylelint stylelint-no-indistinguishable-colors
```## Usage
Update your Stylelint config with following rules:
```
{
"plugins": [
"stylelint-no-indistinguishable-colors"
],
"rules": {
"plugin/stylelint-no-indistinguishable-colors": true
}
}
```## Options
Boolean, or an array of options, where the first element is `true`, and the second is an options object.
### Boolean option
`true`: Enables the plugin. Defaults to Colorguard's threshold of 3.
`false`: Disables the plugin.
### Optional secondary options
Corresponds to Colorguard [options object](https://github.com/SlexAxton/css-colorguard#options).
#### ignore: Array ['#colorA', '#colorB']
Hex color codes that you would like to ignore completely.
#### threshold: Number
Number can be between `0` and `100`. The default value is `3`.
The lower the threshold the more similar the colors have to be to trigger a violation. The higher the threshold, the more violations you will get.
#### whitelist: Array [['#colorA', '#colorB'], ['#colorC', '#colorD']]
An array of color pairs to ignore.
#### allowEquivalentNotation: Boolean
By default, colorguard will complain if identical colors are represented with different notations. For example, `#000`, `#000000`, `rgba(0, 0, 0, 0)`, and `black`. If you want to permit these equivalent notations, set this option to `true`.