stylelint-config-standard
Standard shareable config for Stylelint
Last updated 25 days ago by GitHub Actions .
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 and within Baseline Widely Available.

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

Example

@import url("reset.css") layer(reset);

/**
 * Multi-line comment
 */

@keyframes fade-in {
  to {
    opacity: 1;
  }
}

@layer elements {
  :root {
    --blue: light-dark(#06b, #3af);
  }

  /* Single-line comment */

  html {
    color-scheme: light dark;

    @media (prefers-reduced-motion: no-preference) {
      scroll-behavior: smooth;
    }
  }

  a:visited {
    color: oklch(from var(--blue) l c calc(h + 35));
  }
}

/* Flush single line comment */
@layer custom-elements {
  @scope (cards-element) {
    :scope {
      /* Flush to parent comment */
      display: block grid;

      &:has(> :nth-child(3)) {
        grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
      }
    }
  }

  @scope (card-element) to (slot) {
    :scope {
      container: card / inline-size;
      padding-inline: clamp(1rem, 5cqi, 2rem);
    }

    h2:not(.foo, .bar) {
      font-family: "Arial Black", sans-serif;

      @container card (inline-size >= 10rem) {
        place-self: end;
      }
    }
  }
}

Note: the config is tested against this example, as such the example contains plenty of modern 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

  • 41.0.0                                ...           latest (25 days ago)

55 Versions

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

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