hudochenkov / stylelint-order

A plugin pack of order related linting rules for Stylelint.
MIT License
916 stars 61 forks source link

Complex sorting rule #81

Closed nosovk closed 5 years ago

nosovk commented 5 years ago

Sorting properties in alphabetical order is a good starting point, but better stick to more verbose standard:

  1. Layout Properties (position, float, clear, display)
  2. Box Model Properties (width, height, margin, padding)
  3. Visual Properties (color, background, border, box-shadow)
  4. Typography Properties (font-size, font-family, text-align, text-transform)
  5. Misc Properties (cursor, overflow, z-index)

Is it possible to declare such an order somehow?

hudochenkov commented 5 years ago

Yes. With order/properties-order.

Define your own order or use community configs:

https://www.npmjs.com/package/stylelint-config-recess-order https://www.npmjs.com/package/stylelint-config-rational-order https://www.npmjs.com/package/stylelint-config-idiomatic-order https://www.npmjs.com/package/stylelint-config-property-sort-order-smacss