1. stylelint-config-recess-order
Recess-based property sort order for Stylelint.
stylelint-config-recess-order
Package: stylelint-config-recess-order
Created by: stormwarning
Last modified: Mon, 15 Apr 2024 02:19:40 GMT
Version: 5.0.1
License: ISC
Downloads: 1,027,710
Repository: https://github.com/stormwarning/stylelint-config-recess-order

Install

npm install stylelint-config-recess-order
yarn add stylelint-config-recess-order

Recess* Property Order StyleLint

npm version
npm downloads
github issues

A Stylelint config that sorts CSS properties the way Recess did and
Bootstrap did/does.

*With some modifications & additions for modern properties.

Usage

  1. Add stylelint and this package to your project:
     npm install --save-dev stylelint stylelint-config-recess-order
    
  2. Configure your stylelint configuration file to extend this package:
     module.exports = {
    	extends: ['stylelint-config-recess-order'],
    	rules: {
    		// Add overrides and additional rules here
    	},
    }
    

Advanced

The default setup applies only the 'order/properties-order' rule with the various property groups. If you need to configure other options for this rule,
the groups can be imported separately and the rule configured to your needs.

 const propertyGroups = require('stylelint-config-recess-order/groups')

module.exports = {
	extends: [], // Do not extend the config here.
	rules: {
		// Configure the rule manually.
		'order/properties-order': propertyGroups.map((group) => ({
			...group,
			emptyLineBefore: 'always',
			noEmptyLineBetween: true,
		})),
	},
}

References

@mdo on CSS Property Order

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code