-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathstylelint.config.js
More file actions
163 lines (163 loc) · 4.28 KB
/
stylelint.config.js
File metadata and controls
163 lines (163 loc) · 4.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
// Find rules at https://stylelint.io/user-guide/rules
export default {
extends: ['stylelint-config-standard'],
plugins: ['stylelint-no-unsupported-browser-features', 'stylelint-order'],
ignoreFiles: ['src/theme/styles/**/*.css'],
rules: {
// NOTE: Property ordering by logical groups
'order/properties-order': [
[
// Content & display
'content',
'display',
'visibility',
'opacity',
// Positioning
'position',
'z-index',
'top',
'right',
'bottom',
'left',
'inset',
// Box model
'box-sizing',
'width',
'min-width',
'max-width',
'height',
'min-height',
'max-height',
'margin',
'margin-top',
'margin-right',
'margin-bottom',
'margin-left',
'padding',
'padding-top',
'padding-right',
'padding-bottom',
'padding-left',
'overflow',
'overflow-x',
'overflow-y',
// Flexbox
'flex',
'flex-grow',
'flex-shrink',
'flex-basis',
'flex-direction',
'flex-wrap',
'justify-content',
'align-items',
'align-content',
'align-self',
'order',
'gap',
// Grid
'grid',
'grid-template',
'grid-template-columns',
'grid-template-rows',
'grid-template-areas',
'grid-column',
'grid-row',
// Border
'border',
'border-width',
'border-style',
'border-color',
'border-top',
'border-right',
'border-bottom',
'border-left',
'border-radius',
// Background
'background',
'background-color',
'background-image',
'background-position',
'background-size',
'background-repeat',
// Typography
'color',
'font',
'font-family',
'font-size',
'font-weight',
'font-style',
'line-height',
'letter-spacing',
'text-align',
'text-decoration',
'text-transform',
'white-space',
'word-break',
'word-wrap',
// Visual
'outline',
'outline-width',
'outline-style',
'outline-color',
'outline-offset',
'box-shadow',
'cursor',
'pointer-events',
// Animation
'transition',
'transform',
'animation',
],
{ unspecified: 'bottomAlphabetical' },
],
// TODO: Maybe create an utility or test to make sure
// its computed correctly
// NOTE: BEM naming convention (block-name__elem-name_mod-name_mod-val) per naming convention https://en.bem.info/methodology/naming-convention
'selector-class-pattern': [
'^[a-z][a-z0-9]*(-[a-z0-9]+)*(__[a-z][a-z0-9]*(-[a-z0-9]+)*)?(_[a-z][a-z0-9]*(-[a-z0-9]+)*)?(_[a-z][a-z0-9]*(-[a-z0-9]+)*)?$',
{
message:
'Expected class selector to follow BEM convention (block-name__elem-name_mod-name_mod-val)',
},
],
// NOTE: Disable value-keyword-case for font family names (they are case-sensitive)
'value-keyword-case': [
'lower',
{
ignoreFunctions: ['local'],
ignoreKeywords: [
'BlinkMacSystemFont',
'Roboto',
'Oxygen',
'Ubuntu',
'Cantarell',
'Inter',
'Arial',
'Helvetica',
],
},
],
// NOTE: Browser compatibility warnings (see .browserslistrc)
'plugin/no-unsupported-browser-features': [
true,
{
severity: 'error',
ignore: [
// NOTE: CSS nesting is transpiled by the build toolchain
'css-nesting',
// NOTE: :focus-visible has :focus fallback in place
'css-focus-visible',
// NOTE: iOS doesn't support cursors (touch devices), not applicable
'css3-cursors',
// NOTE: overflow: clip has fallback behavior with hidden
'css-overflow',
],
},
],
// NOTE: Empty lines can help with readability
'at-rule-empty-line-before': null,
'comment-empty-line-before': null,
'custom-property-empty-line-before': null,
'declaration-empty-line-before': null,
},
};