0.1.0 • Published 5 years ago

@yasanchezz/stylelint-color-variables v0.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
5 years ago

stylelint-color-variables

Stylelint plugin to replace colors with others. If you don't have named colors in your project, you can use that plugin to replace hex colors with CSS variables.

Installation and usage

Change your stylelint.config

npm install --save-dev stylelint @yasanchezz/stylelint-color-variables

Add plugin and rule in stylelint.config.js

plugins: [
  '@yasanchezz/stylelint-color-variables',
],

rules: {
  'color-variables/no-redefined-color': true,
},

Create the file with options

You need to create stylelint-color-variables.json with the same contents as

{
  "exclude": [],
  "colors": {
    "#fff": "white"
  }
}

exclude - array of globs, which paths will be ignored. colors: - object, key's string will be finded and replaced by value's string.