1.2.0 • Published 5 years ago

stylelint-postcss-custom-properties v1.2.0

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

stylelint-postcss-custom-properties

A stylelint plugin that reveals values defined with PostCSS Custom Properties plugin.

A error from the plugin looks like this:

1:1  ✖  The value (or a part of it) should be presented as a custom property: "#FFF" is "--white"

Installation

npm install stylelint-postcss-custom-properties

Usage

Add it to your stylelint config plugins array, then add "plugin/postcss-custom-properties" to your rules, specifying the customPropertiesFilePath option with path of a JSON or JS file that contains list of custom properties.

Like so:

// .stylelintrc
{
  "plugins": [
    "stylelint-postcss-custom-properties"
  ],
  "rules": {
    // ...
    "plugin/postcss-custom-properties": {
       "customPropertiesFilePath": "./customProperties.json"
    },
    // ...
  }
}

Custom properties file format

For now, the plugin works with JSON or JS files only, CSS files are not supported.

See example files written in JSON and JS.