stylelint-config-standard (34.0.0)

Published 2026-02-24 14:05:51 +00:00 by atheaadmin

Installation

registry=
npm install stylelint-config-standard@34.0.0
"stylelint-config-standard": "34.0.0"

About this package

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

Dependencies

Dependencies

ID Version
stylelint-config-recommended ^13.0.0

Development Dependencies

ID Version
@stylelint/prettier-config ^2.0.0
@stylelint/remark-preset ^4.0.0
eslint ^8.43.0
eslint-config-stylelint ^18.0.0
eslint-plugin-jest ^27.2.1
husky ^8.0.3
jest ^29.5.0
lint-staged ^13.2.2
np ^8.0.4
npm-run-all ^4.1.5
prettier ^2.8.8
remark-cli ^11.0.0
stylelint ^15.10.0

Peer Dependencies

ID Version
stylelint ^15.10.0

Keywords

stylelint stylelint-config standard
Details
npm
2026-02-24 14:05:51 +00:00
0
Stylelint
MIT
latest
3.4 KiB
Assets (1)
Versions (1) View all
34.0.0 2026-02-24