JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2535
  • Score
    100M100P100Q154557F
  • License MIT

Stylelint plugin to add rule no-indistinguishable-colors

Package Exports

  • stylelint-no-indistinguishable-colors

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (stylelint-no-indistinguishable-colors) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

stylelint-no-indistinguishable-colors

Stylelint plugin that disallow colors that are suspiciously close to being identical, using 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 array of options, where the first element is true, and the second is object of options.

true

Defaults to Colorguard's threshold of 3.

Optional secondary options

Corresponds to Colorguard options object.

ignore: Array ['#colorA', '#colorB']

Hex codes of colors that you would like to ignore completely

threshold: Number

Number can be between 0 and 100. The default is 3.

The lower the threshold, the more similar 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.