stylelint-max-selectors

0.3.0 • Public • Published

stylelint-max-selectors

Build Status

A stylelint plugin that enforces maximum selector count for a stylesheet. Useful if you need to support old IE (<IE10) which has a limit of 4095 selectors or just for performance reasons.

Installation

npm install stylelint-max-selectors

Usage

Add it to your stylelint config plugins array, then add "plugin/max-selectors" to your rules.

Like so:

// .stylelintrc
{
  "plugins": [
    "stylelint-max-selectors"
  ],
  "rules": {
    // ...
    "plugin/max-selectors": 4095,
    // ...
  }
}

Options

int: Maximum number of selectors allowed.

For example the following stylesheet has 2 selectors:

.foo, .bar {
  color: red
}

/stylelint-max-selectors/

    Package Sidebar

    Install

    npm i stylelint-max-selectors

    Weekly Downloads

    0

    Version

    0.3.0

    License

    MIT

    Unpacked Size

    3.95 kB

    Total Files

    7

    Last publish

    Collaborators

    • asapach