Skip to content
This repository was archived by the owner on Dec 27, 2022. It is now read-only.

Commit 89ef66a

Browse files
committed
first commit
0 parents  commit 89ef66a

17 files changed

+2448
-0
lines changed

.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
[*]
7+
indent_style = space
8+
indent_size = 2
9+
end_of_line = lf
10+
charset = utf-8
11+
trim_trailing_whitespace = true
12+
insert_final_newline = true
13+
max_line_length = 120

.eslintrc.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"commonjs": true,
5+
"es2021": true,
6+
"mocha": true
7+
},
8+
"extends": "alloy",
9+
"overrides": [],
10+
"parserOptions": {
11+
"ecmaVersion": "latest"
12+
},
13+
"rules": {}
14+
}

.gitignore

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

README.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# stylelint-config-random-order
2+
3+
一份 stylelint 配置,使用 [stylelint-order](https://github.com/hudochenkov/stylelint-order) 对 CSS 属性\* 进行排序。
4+
5+
\* 包含眼熟的和感兴趣的,欢迎补充。
6+
7+
## 用法
8+
9+
安装 [stylelint](https://github.com/stylelint/stylelint),并将此包添加到你的项目中。
10+
11+
```sh
12+
pnpm add -D stylelint stylelint-config-random-order
13+
```
14+
15+
配置你的 stylelint 配置文件(`.stylelintrc.json`)以启用此包。
16+
17+
```diff
18+
{
19+
+ "extends": ["stylelint-config-random-order"],
20+
- // this package already does for you
21+
- "plugins": ["stylelint-order"],
22+
+ "rules": {
23+
+ // Add overrides and additional rules here
24+
+ }
25+
}
26+
```
27+
28+
## 参考
29+
30+
- [stormwarning/styleint-config-recess-order](https://github.com/stormwarning/stylelint-config-recess-order)
31+
- [kutsan/stylelint-config-clean-order](https://github.com/kutsan/stylelint-config-clean-order)

groups/background.js

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module.exports = [
2+
"color-scheme",
3+
"background",
4+
"background-image",
5+
"background-position",
6+
"background-position-x",
7+
"background-position-y",
8+
"background-size",
9+
"background-repeat",
10+
"background-repeat-x",
11+
"background-repeat-y",
12+
"background-attachment",
13+
"background-color",
14+
"backdrop-filter",
15+
"filter",
16+
"opacity",
17+
"outline",
18+
"outline-width",
19+
"outline-style",
20+
"outline-color",
21+
"outline-offset",
22+
"box-shadow",
23+
];

groups/borderbox.js

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
module.exports = [
2+
"box-sizing",
3+
"width",
4+
"height",
5+
"inline-size",
6+
"block-size",
7+
"aspect-ratio",
8+
"min-width",
9+
"max-width",
10+
"min-height",
11+
"max-height",
12+
"min-inline-size",
13+
"max-inline-size",
14+
"min-block-size",
15+
"max-block-size",
16+
"margin",
17+
"margin-top",
18+
"margin-right",
19+
"margin-bottom",
20+
"margin-left",
21+
"margin-block",
22+
"margin-block-start",
23+
"margin-block-end",
24+
"margin-inline",
25+
"margin-inline-start",
26+
"margin-inline-end",
27+
"padding",
28+
"padding-top",
29+
"padding-right",
30+
"padding-bottom",
31+
"padding-left",
32+
"padding-block",
33+
"padding-block-start",
34+
"padding-block-end",
35+
"padding-inline",
36+
"padding-inline-start",
37+
"padding-inline-end",
38+
"border",
39+
"border-width",
40+
"border-style",
41+
"border-color",
42+
"border-top",
43+
"border-top-width",
44+
"border-top-style",
45+
"border-top-color",
46+
"border-right",
47+
"border-right-width",
48+
"border-right-style",
49+
"border-right-color",
50+
"border-bottom",
51+
"border-bottom-width",
52+
"border-bottom-style",
53+
"border-bottom-color",
54+
"border-left",
55+
"border-left-width",
56+
"border-left-style",
57+
"border-left-color",
58+
"border-inline",
59+
"border-inline-width",
60+
"border-inline-style",
61+
"border-inline-color",
62+
"border-inline-start",
63+
"border-inline-start-width",
64+
"border-inline-start-style",
65+
"border-inline-start-color",
66+
"border-inline-end",
67+
"border-inline-end-width",
68+
"border-inline-end-style",
69+
"border-inline-end-color",
70+
"border-block",
71+
"border-block-width",
72+
"border-block-style",
73+
"border-block-color",
74+
"border-block-start",
75+
"border-block-start-width",
76+
"border-block-start-style",
77+
"border-block-start-color",
78+
"border-block-end",
79+
"border-block-end-width",
80+
"border-block-end-style",
81+
"border-block-end-color",
82+
"border-radius",
83+
"border-top-left-radius",
84+
"border-top-right-radius",
85+
"border-bottom-right-radius",
86+
"border-bottom-left-radius",
87+
"border-start-start-radius",
88+
"border-start-end-radius",
89+
"border-end-start-radius",
90+
"border-end-end-radius",
91+
];

groups/interaction.js

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
module.exports = [
2+
"overflow",
3+
"overflow-x",
4+
"overflow-y",
5+
"scrollbar-color",
6+
"scrollbar-width",
7+
"scrollbar-gutter",
8+
"scroll-behavior",
9+
"scroll-snap-type",
10+
"scroll-snap-align",
11+
"scroll-margin",
12+
"scroll-margin-top",
13+
"scroll-margin-right",
14+
"scroll-margin-bottom",
15+
"scroll-margin-left",
16+
"scroll-margin-inline",
17+
"scroll-margin-inline-start",
18+
"scroll-margin-inline-end",
19+
"scroll-margin-block",
20+
"scroll-margin-block-start",
21+
"scroll-margin-block-end",
22+
"scroll-padding",
23+
"scroll-padding-top",
24+
"scroll-padding-right",
25+
"scroll-padding-bottom",
26+
"scroll-padding-left",
27+
"scroll-padding-inline",
28+
"scroll-padding-inline-start",
29+
"scroll-padding-inline-end",
30+
"scroll-padding-block",
31+
"scroll-padding-block-start",
32+
"scroll-padding-block-end",
33+
"overscroll-behavior",
34+
"overscroll-behavior-x",
35+
"overscroll-behavior-y",
36+
"overscroll-behavior-inline",
37+
"overscroll-behavior-block",
38+
"user-select",
39+
"cursor",
40+
];

groups/layout.js

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
module.exports = [
2+
"flex",
3+
"flex-grow",
4+
"flex-shrink",
5+
"flex-basis",
6+
"grid-area",
7+
"grid-row",
8+
"grid-row-start",
9+
"grid-row-end",
10+
"grid-column",
11+
"grid-column-start",
12+
"grid-column-end",
13+
"place-self",
14+
"justify-self",
15+
"align-self",
16+
"order",
17+
"display", // as the dividing line
18+
"flex-flow",
19+
"flex-direction",
20+
"flex-wrap",
21+
"grid",
22+
"grid-template",
23+
"grid-template-rows",
24+
"grid-template-columns",
25+
"grid-template-areas",
26+
"grid-auto-rows",
27+
"grid-auto-columns",
28+
"grid-auto-flow",
29+
"columns",
30+
"column-width",
31+
"column-count",
32+
"gap",
33+
"row-gap",
34+
"column-gap",
35+
"place-content",
36+
"justify-content",
37+
"align-content",
38+
"place-items",
39+
"justify-items",
40+
"align-items",
41+
"column-rule",
42+
"column-rule-width",
43+
"column-rule-style",
44+
"column-rule-color",
45+
"column-span",
46+
"break-inside",
47+
];

groups/position.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module.exports = [
2+
"position",
3+
"top",
4+
"right",
5+
"bottom",
6+
"left",
7+
"inset",
8+
"inset-inline",
9+
"inset-inline-start",
10+
"inset-inline-end",
11+
"inset-block",
12+
"inset-block-start",
13+
"inset-block-end",
14+
"z-index",
15+
];

groups/transition.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = [
2+
"visibility",
3+
"transform",
4+
"transform-origin",
5+
"transition",
6+
"transition-property",
7+
"transition-duration",
8+
"transition-timing-function",
9+
"transition-delay",
10+
];

groups/typography.js

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
module.exports = [
2+
"float",
3+
"clear",
4+
"object-fit",
5+
"object-position",
6+
"writing-mode",
7+
"font",
8+
"font-family",
9+
"font-size",
10+
"font-weight",
11+
"font-style",
12+
"line-height",
13+
"color",
14+
"text-align",
15+
"text-decoration",
16+
"text-decoration-line",
17+
"text-decoration-style",
18+
"text-decoration-color",
19+
"text-underline-position",
20+
"text-underline-offset",
21+
"text-transform",
22+
"text-shadow",
23+
"text-indent",
24+
"tab-size",
25+
"letter-spacing",
26+
"word-spacing",
27+
"word-break",
28+
"line-break",
29+
"vertical-align",
30+
"list-style",
31+
"list-style-position",
32+
"list-style-image",
33+
"list-style-type",
34+
];

index.js

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
const position = require("./groups/position.js");
2+
const layout = require("./groups/layout.js");
3+
const borderBox = require("./groups/borderbox.js");
4+
const typography = require("./groups/typography.js");
5+
const interaction = require("./groups/interaction.js");
6+
const background = require("./groups/background.js");
7+
const transition = require("./groups/transition.js");
8+
9+
module.exports = {
10+
plugins: ["stylelint-order"],
11+
rules: {
12+
"order/properties-order": [
13+
{
14+
// for reset, etc
15+
properties: ["all", "apperance", "table-layout", "border-collapse"],
16+
},
17+
{
18+
properties: position,
19+
},
20+
{
21+
properties: layout,
22+
},
23+
{
24+
properties: borderBox,
25+
},
26+
{
27+
properties: typography,
28+
},
29+
{
30+
properties: interaction,
31+
},
32+
{
33+
properties: background,
34+
},
35+
{
36+
properties: transition,
37+
},
38+
],
39+
},
40+
};

0 commit comments

Comments
 (0)