Skip to content
项目

stormwarning/stylelint-config-recess-order

在 GitHub 查看

关于

🗂️ 基于 Recess 的 Stylelint 属性排序规则。

网站与应用开发

这些数字如何统计

实测星标增长

24小时
0
7天
0
15天
+3
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

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, stylelint-order, and this package to your project:
    npm install --save-dev stylelint stylelint-order stylelint-config-recess-order
    
  2. Configure your Stylelint configuration file to extend this package:
    /** @type {import('stylelint').Config} */
    export default {
        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.

import propertyGroups from 'stylelint-config-recess-order/groups'

/** @type {import('stylelint').Config} */
export default {
	extends: [], // Do not extend the config here.
	rules: {
		// Configure the rule manually.
		'order/properties-order': propertyGroups.map((group) => ({
			...group,
			emptyLineBefore: 'always',
			noEmptyLineBetween: true,
		})),
	},
}

[!TIP] If you need the Recess property order for any Rust-based tooling, there’s now a crate for that!

References

@mdo on CSS Property Order

探索相关项目

加载中…