1.0.0 • Published 4 years ago

stylelint-config-semantic-order v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

Stylelint Config Semantic Order

NPM version GitHub Workflow Status release Code Coverage

Opinionated stylelint config order semantically grouping related css properties.

Installation

NPM

npm i -D stylelint-config-semantic-order

Yarn

yarn add -D stylelint-config-semantic-order

Usage

Add stylelint-config-semantic-order your Stylelint config extends:

{
  "extends": "stylelint-config-semantic-order"
}

Learn more about Stylelint.

Rationale

We aim for understandable, scannable and consistent code without changing the specificity. A logical ordering of rules and declarations allows you to “scan” quickly.

Properties

Properties with the largest impact (scope and/or importance) are put first. Using concepts from both Idiomatic CSS and ITCSS we setup our config by:

  1. Ordering on impact\ Rules with a larger scope or more effect on the layout and box size have more impact on the UI. Seeing rules with more impact first increases understanding.
  2. Grouping by relationship\ Grouping all properties related to typography and theming makes them easier to find.

Groups

Related property declarations are grouped in the following order:

  1. Specials
  2. Positioning
  3. Display
  4. Box
  5. Box model
  6. Table
  7. Typography
  8. Theming
  9. Accessibility & Interactions
  10. SVG presentation
  11. Transition & animation

Sources

The following sources have been used as inspiration for this config: