Home

Awesome

stylelint-8-point-grid

Node.js CI

Validates any defined margin, padding, height, and width.

Supports pixel and rem values.

Inspiration

Ignores

Installation

npm

npm install stylelint-8-point-grid --save-dev

yarn

yarn add stylelint-8-point-grid --dev

Usage

Update .stylelintrc or stylelint config in package.json.

Recommended config

// .stylelintrc
{
  "extends": [
    "stylelint-8-point-grid"
  ]
}

Uses base 8 for pixel values (and base 0.5 for rem values).

Extending the config

// .stylelintrc
{
  "extends": [
    "stylelint-8-point-grid"
  ],
  "rules": {
    "plugin/8-point-grid": {
      "base": 4,
      "allowlist": ["2px", "1px", "0.0625rem"],
      "customProperties": ['size', 'position'],
      "ignorelist": ["width", "height"]
    }
  }
}

base

using 4 as base means:

customProperties

allowlist

ignorelist

License

MIT