stylelint-config-standard
Standard shareable config for Stylelint
Last updated a year ago by ybiquitous .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install stylelint-config-standard 
SYNC missed versions from official npm registry.

stylelint-config-standard

NPM version Build Status

The standard shareable config for Stylelint.

It extends stylelint-config-recommended and turns on additional rules to enforce modern conventions found in the CSS specifications.

To see the rules that this config uses, please read the config itself.

Example

@import url("foo.css");
@import url("bar.css");

@custom-media --foo (min-width: 30em);

/**
 * Multi-line comment
 */

:root {
  --brand-red: hsl(5deg 10% 40%);
}

/* Single-line comment */

.class-foo:not(a, div) {
  margin: 0;
  top: calc(100% - 2rem);
}

/* Flush single line comment */
@media (width >= 60em) {
  #id-bar {
    /* Flush to parent comment */
    --offset: 0px;

    color: #fff;
    font-family: Helvetica, "Arial Black", sans-serif;
    left: calc(var(--offset) + 50%);
  }

  /* Flush nested single line comment */
  a::after {
    display: block;
    content: "→";
    background-image: url("x.svg");
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

Note: the config is tested against this example, as such the example contains plenty of CSS syntax and features.

Installation

npm install stylelint-config-standard --save-dev

Usage

Set your Stylelint config to:

{
  "extends": "stylelint-config-standard"
}

Extending the config

Add a "rules" key to your config, then add your overrides and additions there.

You can turn off rules by setting its value to null. For example:

{
  "extends": "stylelint-config-standard",
  "rules": {
    "selector-class-pattern": null
  }
}

Or lower the severity of a rule to a warning using the severity secondary option. For example:

{
  "extends": "stylelint-config-standard",
  "rules": {
    "property-no-vendor-prefix": [
      true,
      {
        "severity": "warning"
      }
    ]
  }
}

Or to add a rule, For example, the unit-allowed-list one:

{
  "extends": "stylelint-config-standard",
  "rules": {
    "unit-allowed-list": ["em", "rem", "s"]
  }
}

We recommend adding more of Stylelint's rules to your config as these rules need to be configured to suit your specific needs.

Changelog

License

Current Tags

  • 36.0.1                                ...           latest (6 months ago)
  • 23.0.0-0                                ...           next (3 years ago)

48 Versions

  • 36.0.1                                ...           6 months ago
  • 36.0.0                                ...           a year ago
  • 35.0.0                                ...           a year ago
  • 34.0.0                                ...           a year ago
  • 33.0.0                                ...           2 years ago
  • 32.0.0                                ...           2 years ago
  • 31.0.0                                ...           2 years ago
  • 30.0.1                                ...           2 years ago
  • 30.0.0                                ...           2 years ago
  • 29.0.0                                ...           2 years ago
  • 28.0.0                                ...           2 years ago
  • 27.0.0                                ...           2 years ago
  • 26.0.0                                ...           3 years ago
  • 25.0.0                                ...           3 years ago
  • 24.0.0                                ...           3 years ago
  • 23.0.0                                ...           3 years ago
  • 23.0.0-0                                ...           3 years ago
  • 22.0.0                                ...           4 years ago
  • 21.0.0                                ...           4 years ago
  • 20.0.0                                ...           5 years ago
  • 19.0.0                                ...           5 years ago
  • 18.3.0                                ...           6 years ago
  • 18.2.0                                ...           7 years ago
  • 18.1.0                                ...           7 years ago
  • 18.0.0                                ...           7 years ago
  • 17.0.0                                ...           7 years ago
  • 16.0.0                                ...           8 years ago
  • 15.0.1                                ...           8 years ago
  • 15.0.0                                ...           8 years ago
  • 14.0.0                                ...           8 years ago
  • 13.0.2                                ...           8 years ago
  • 13.0.1                                ...           8 years ago
  • 13.0.0                                ...           8 years ago
  • 12.0.0                                ...           8 years ago
  • 11.0.0                                ...           8 years ago
  • 10.0.0                                ...           8 years ago
  • 9.0.0                                ...           9 years ago
  • 8.0.0                                ...           9 years ago
  • 7.0.0                                ...           9 years ago
  • 6.0.0                                ...           9 years ago
  • 5.0.0                                ...           9 years ago
  • 4.0.1                                ...           9 years ago
  • 4.0.0                                ...           9 years ago
  • 3.0.0                                ...           9 years ago
  • 2.0.0                                ...           9 years ago
  • 1.0.0                                ...           9 years ago
  • 0.2.0                                ...           9 years ago
  • 0.1.0                                ...           9 years ago
Downloads
Total 2
Today 1
This Week 1
This Month 2
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (11)

© 2010 - cnpmjs.org x YWFE | Home | YWFE