@antebudimir/eslint-plugin-vanilla-extract 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +242 -0
- package/dist/css/test.css.d.ts +159 -0
- package/dist/css/test.css.js +468 -0
- package/dist/css/testFileForOtherMethods.css.d.ts +3 -0
- package/dist/css/testFileForOtherMethods.css.js +101 -0
- package/dist/css-rules/alphabetical-order/index.d.ts +2 -0
- package/dist/css-rules/alphabetical-order/index.js +2 -0
- package/dist/css-rules/alphabetical-order/property-order-enforcer.d.ts +14 -0
- package/dist/css-rules/alphabetical-order/property-order-enforcer.js +57 -0
- package/dist/css-rules/alphabetical-order/recipe-order-enforcer.d.ts +14 -0
- package/dist/css-rules/alphabetical-order/recipe-order-enforcer.js +22 -0
- package/dist/css-rules/alphabetical-order/rule-definition.d.ts +3 -0
- package/dist/css-rules/alphabetical-order/rule-definition.js +20 -0
- package/dist/css-rules/alphabetical-order/style-object-processor.d.ts +15 -0
- package/dist/css-rules/alphabetical-order/style-object-processor.js +28 -0
- package/dist/css-rules/concentric-order/concentric-groups.d.ts +7 -0
- package/dist/css-rules/concentric-order/concentric-groups.js +307 -0
- package/dist/css-rules/concentric-order/index.d.ts +2 -0
- package/dist/css-rules/concentric-order/index.js +2 -0
- package/dist/css-rules/concentric-order/property-order-enforcer.d.ts +16 -0
- package/dist/css-rules/concentric-order/property-order-enforcer.js +60 -0
- package/dist/css-rules/concentric-order/recipe-order-enforcer.d.ts +14 -0
- package/dist/css-rules/concentric-order/recipe-order-enforcer.js +22 -0
- package/dist/css-rules/concentric-order/rule-definition.d.ts +3 -0
- package/dist/css-rules/concentric-order/rule-definition.js +20 -0
- package/dist/css-rules/concentric-order/style-object-processor.d.ts +21 -0
- package/dist/css-rules/concentric-order/style-object-processor.js +59 -0
- package/dist/css-rules/concentric-order/types.d.ts +8 -0
- package/dist/css-rules/concentric-order/types.js +1 -0
- package/dist/css-rules/custom-order/property-order-enforcer.d.ts +17 -0
- package/dist/css-rules/custom-order/property-order-enforcer.js +67 -0
- package/dist/css-rules/custom-order/recipe-order-enforcer.d.ts +16 -0
- package/dist/css-rules/custom-order/recipe-order-enforcer.js +24 -0
- package/dist/css-rules/custom-order/rule-definition.d.ts +3 -0
- package/dist/css-rules/custom-order/rule-definition.js +40 -0
- package/dist/css-rules/custom-order/style-object-processor.d.ts +19 -0
- package/dist/css-rules/custom-order/style-object-processor.js +52 -0
- package/dist/css-rules/shared-utils/css-order-fixer.d.ts +17 -0
- package/dist/css-rules/shared-utils/css-order-fixer.js +39 -0
- package/dist/css-rules/shared-utils/css-property-priority-map.d.ts +25 -0
- package/dist/css-rules/shared-utils/css-property-priority-map.js +48 -0
- package/dist/css-rules/shared-utils/nested-selectors-processor.d.ts +25 -0
- package/dist/css-rules/shared-utils/nested-selectors-processor.js +35 -0
- package/dist/css-rules/shared-utils/order-strategy-visitor-creator.d.ts +17 -0
- package/dist/css-rules/shared-utils/order-strategy-visitor-creator.js +76 -0
- package/dist/css-rules/shared-utils/property-separator.d.ts +28 -0
- package/dist/css-rules/shared-utils/property-separator.js +49 -0
- package/dist/css-rules/shared-utils/recipe-property-processor.d.ts +16 -0
- package/dist/css-rules/shared-utils/recipe-property-processor.js +37 -0
- package/dist/css-rules/shared-utils/style-node-processor.d.ts +9 -0
- package/dist/css-rules/shared-utils/style-node-processor.js +22 -0
- package/dist/css-sample/sample.css.d.ts +161 -0
- package/dist/css-sample/sample.css.js +551 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.js +37 -0
- package/package.json +75 -0
|
@@ -0,0 +1,468 @@
|
|
|
1
|
+
import { globalStyle, style, styleVariants } from '@vanilla-extract/css';
|
|
2
|
+
import { recipe } from '@vanilla-extract/recipes';
|
|
3
|
+
globalStyle('*, ::before, ::after', {
|
|
4
|
+
margin: '0',
|
|
5
|
+
fontSize: 'large',
|
|
6
|
+
border: 'Background',
|
|
7
|
+
borderRight: 'ActiveBorder',
|
|
8
|
+
borderLeft: 'ActiveBorder',
|
|
9
|
+
borderRadius: 'initial',
|
|
10
|
+
borderBottomLeftRadius: 'initial',
|
|
11
|
+
borderBottomRightRadius: 'initial',
|
|
12
|
+
boxSizing: 'inherit',
|
|
13
|
+
position: 'relative',
|
|
14
|
+
right: 'inherit',
|
|
15
|
+
display: 'flex',
|
|
16
|
+
gap: 'revert',
|
|
17
|
+
transform: 'none',
|
|
18
|
+
outline: 'none',
|
|
19
|
+
backgroundColor: 'initial',
|
|
20
|
+
cursor: 'pointer',
|
|
21
|
+
color: 'red',
|
|
22
|
+
});
|
|
23
|
+
export const root = style({
|
|
24
|
+
// These 2 prevent the content from overflowing the container in Brave when the accordion's open
|
|
25
|
+
// Safari, however, requires more - see accordionContentBase styles
|
|
26
|
+
margin: '0',
|
|
27
|
+
fontSize: 'large',
|
|
28
|
+
border: 'Background',
|
|
29
|
+
borderRight: 'ActiveBorder',
|
|
30
|
+
borderLeft: 'ActiveBorder',
|
|
31
|
+
borderRadius: 'initial',
|
|
32
|
+
borderBottomLeftRadius: 'initial',
|
|
33
|
+
borderBottomRightRadius: 'initial',
|
|
34
|
+
boxSizing: 'inherit',
|
|
35
|
+
position: 'relative',
|
|
36
|
+
right: 'inherit',
|
|
37
|
+
display: 'flex',
|
|
38
|
+
gap: 'revert',
|
|
39
|
+
transform: 'none',
|
|
40
|
+
outline: 'none',
|
|
41
|
+
backgroundColor: 'initial',
|
|
42
|
+
cursor: 'pointer',
|
|
43
|
+
color: 'red',
|
|
44
|
+
selectors: {
|
|
45
|
+
'&:not(:first-child)': {
|
|
46
|
+
margin: '0',
|
|
47
|
+
fontSize: 'large',
|
|
48
|
+
border: 'Background',
|
|
49
|
+
borderRight: 'ActiveBorder',
|
|
50
|
+
borderLeft: 'ActiveBorder',
|
|
51
|
+
borderRadius: 'initial',
|
|
52
|
+
borderBottomLeftRadius: 'initial',
|
|
53
|
+
borderBottomRightRadius: 'initial',
|
|
54
|
+
boxSizing: 'inherit',
|
|
55
|
+
position: 'relative',
|
|
56
|
+
right: 'inherit',
|
|
57
|
+
display: 'flex',
|
|
58
|
+
gap: 'revert',
|
|
59
|
+
transform: 'none',
|
|
60
|
+
outline: 'none',
|
|
61
|
+
backgroundColor: 'initial',
|
|
62
|
+
cursor: 'pointer',
|
|
63
|
+
color: 'red',
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
export const item = style({
|
|
68
|
+
margin: '0',
|
|
69
|
+
fontSize: 'large',
|
|
70
|
+
border: 'Background',
|
|
71
|
+
borderRight: 'ActiveBorder',
|
|
72
|
+
borderLeft: 'ActiveBorder',
|
|
73
|
+
borderRadius: 'initial',
|
|
74
|
+
borderBottomLeftRadius: 'initial',
|
|
75
|
+
borderBottomRightRadius: 'initial',
|
|
76
|
+
boxSizing: 'inherit',
|
|
77
|
+
position: 'relative',
|
|
78
|
+
right: 'inherit',
|
|
79
|
+
display: 'flex',
|
|
80
|
+
gap: 'revert',
|
|
81
|
+
transform: 'none',
|
|
82
|
+
outline: 'none',
|
|
83
|
+
backgroundColor: 'initial',
|
|
84
|
+
cursor: 'pointer',
|
|
85
|
+
color: 'red',
|
|
86
|
+
});
|
|
87
|
+
const triggerBase = style({
|
|
88
|
+
margin: '0',
|
|
89
|
+
fontSize: 'large',
|
|
90
|
+
border: 'Background',
|
|
91
|
+
borderRight: 'ActiveBorder',
|
|
92
|
+
borderLeft: 'ActiveBorder',
|
|
93
|
+
borderRadius: 'initial',
|
|
94
|
+
borderBottomLeftRadius: 'initial',
|
|
95
|
+
borderBottomRightRadius: 'initial',
|
|
96
|
+
boxSizing: 'inherit',
|
|
97
|
+
position: 'relative',
|
|
98
|
+
right: 'inherit',
|
|
99
|
+
display: 'flex',
|
|
100
|
+
gap: 'revert',
|
|
101
|
+
transform: 'none',
|
|
102
|
+
outline: 'none',
|
|
103
|
+
backgroundColor: 'initial',
|
|
104
|
+
cursor: 'pointer',
|
|
105
|
+
color: 'red',
|
|
106
|
+
':focus-visible': {
|
|
107
|
+
margin: '0',
|
|
108
|
+
fontSize: 'large',
|
|
109
|
+
border: 'Background',
|
|
110
|
+
borderRight: 'ActiveBorder',
|
|
111
|
+
borderLeft: 'ActiveBorder',
|
|
112
|
+
borderRadius: 'initial',
|
|
113
|
+
borderBottomLeftRadius: 'initial',
|
|
114
|
+
borderBottomRightRadius: 'initial',
|
|
115
|
+
boxShadow: 'none',
|
|
116
|
+
boxSizing: 'inherit',
|
|
117
|
+
position: 'relative',
|
|
118
|
+
right: 'inherit',
|
|
119
|
+
display: 'flex',
|
|
120
|
+
gap: 'revert',
|
|
121
|
+
transform: 'none',
|
|
122
|
+
outline: 'none',
|
|
123
|
+
backgroundColor: 'initial',
|
|
124
|
+
cursor: 'pointer',
|
|
125
|
+
color: 'red',
|
|
126
|
+
},
|
|
127
|
+
});
|
|
128
|
+
export const selectButtonVariants = styleVariants({
|
|
129
|
+
bordered: {
|
|
130
|
+
margin: '0',
|
|
131
|
+
fontSize: 'large',
|
|
132
|
+
border: 'Background',
|
|
133
|
+
borderRight: 'ActiveBorder',
|
|
134
|
+
borderLeft: 'ActiveBorder',
|
|
135
|
+
borderRadius: 'initial',
|
|
136
|
+
borderBottomLeftRadius: 'initial',
|
|
137
|
+
borderBottomRightRadius: 'initial',
|
|
138
|
+
boxSizing: 'inherit',
|
|
139
|
+
position: 'relative',
|
|
140
|
+
right: 'inherit',
|
|
141
|
+
display: 'flex',
|
|
142
|
+
gap: 'revert',
|
|
143
|
+
transform: 'none',
|
|
144
|
+
outline: 'none',
|
|
145
|
+
backgroundColor: 'initial',
|
|
146
|
+
cursor: 'pointer',
|
|
147
|
+
color: 'red',
|
|
148
|
+
},
|
|
149
|
+
borderless: {
|
|
150
|
+
margin: '0',
|
|
151
|
+
fontSize: 'large',
|
|
152
|
+
border: 'Background',
|
|
153
|
+
borderRight: 'ActiveBorder',
|
|
154
|
+
borderLeft: 'ActiveBorder',
|
|
155
|
+
borderRadius: 'initial',
|
|
156
|
+
borderBottomLeftRadius: 'initial',
|
|
157
|
+
borderBottomRightRadius: 'initial',
|
|
158
|
+
boxShadow: 'none',
|
|
159
|
+
boxSizing: 'inherit',
|
|
160
|
+
position: 'relative',
|
|
161
|
+
right: 'inherit',
|
|
162
|
+
display: 'flex',
|
|
163
|
+
gap: 'revert',
|
|
164
|
+
transform: 'none',
|
|
165
|
+
outline: 'none',
|
|
166
|
+
backgroundColor: 'initial',
|
|
167
|
+
cursor: 'pointer',
|
|
168
|
+
color: 'red',
|
|
169
|
+
},
|
|
170
|
+
});
|
|
171
|
+
export const trigger = recipe({
|
|
172
|
+
base: triggerBase,
|
|
173
|
+
variants: {
|
|
174
|
+
isOpen: {
|
|
175
|
+
false: {
|
|
176
|
+
margin: '0',
|
|
177
|
+
fontSize: 'large',
|
|
178
|
+
border: 'Background',
|
|
179
|
+
borderRight: 'ActiveBorder',
|
|
180
|
+
borderLeft: 'ActiveBorder',
|
|
181
|
+
borderRadius: 'initial',
|
|
182
|
+
borderBottomLeftRadius: 'initial',
|
|
183
|
+
borderBottomRightRadius: 'initial',
|
|
184
|
+
boxShadow: 'none',
|
|
185
|
+
boxSizing: 'inherit',
|
|
186
|
+
position: 'relative',
|
|
187
|
+
right: 'inherit',
|
|
188
|
+
display: 'flex',
|
|
189
|
+
gap: 'revert',
|
|
190
|
+
transform: 'none',
|
|
191
|
+
outline: 'none',
|
|
192
|
+
backgroundColor: 'initial',
|
|
193
|
+
cursor: 'pointer',
|
|
194
|
+
color: 'red',
|
|
195
|
+
// TODO: https://maglit.me/add-animation-to-accordion-button
|
|
196
|
+
':hover': {
|
|
197
|
+
margin: '0',
|
|
198
|
+
fontSize: 'large',
|
|
199
|
+
border: 'Background',
|
|
200
|
+
borderRight: 'ActiveBorder',
|
|
201
|
+
borderLeft: 'ActiveBorder',
|
|
202
|
+
borderRadius: 'initial',
|
|
203
|
+
borderBottomLeftRadius: 'initial',
|
|
204
|
+
borderBottomRightRadius: 'initial',
|
|
205
|
+
boxShadow: 'none',
|
|
206
|
+
boxSizing: 'inherit',
|
|
207
|
+
position: 'relative',
|
|
208
|
+
right: 'inherit',
|
|
209
|
+
display: 'flex',
|
|
210
|
+
gap: 'revert',
|
|
211
|
+
transform: 'none',
|
|
212
|
+
outline: 'none',
|
|
213
|
+
backgroundColor: 'initial',
|
|
214
|
+
cursor: 'pointer',
|
|
215
|
+
color: 'red',
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
|
+
true: {
|
|
219
|
+
margin: '0',
|
|
220
|
+
fontSize: 'large',
|
|
221
|
+
border: 'Background',
|
|
222
|
+
borderRight: 'ActiveBorder',
|
|
223
|
+
borderLeft: 'ActiveBorder',
|
|
224
|
+
borderRadius: 'initial',
|
|
225
|
+
borderBottomLeftRadius: 'initial',
|
|
226
|
+
borderBottomRightRadius: 'initial',
|
|
227
|
+
boxShadow: 'none',
|
|
228
|
+
boxSizing: 'inherit',
|
|
229
|
+
position: 'relative',
|
|
230
|
+
right: 'inherit',
|
|
231
|
+
display: 'flex',
|
|
232
|
+
gap: 'revert',
|
|
233
|
+
transform: 'none',
|
|
234
|
+
outline: 'none',
|
|
235
|
+
backgroundColor: 'initial',
|
|
236
|
+
cursor: 'pointer',
|
|
237
|
+
color: 'red',
|
|
238
|
+
':hover': {
|
|
239
|
+
margin: '0',
|
|
240
|
+
fontSize: 'large',
|
|
241
|
+
border: 'Background',
|
|
242
|
+
borderRight: 'ActiveBorder',
|
|
243
|
+
borderLeft: 'ActiveBorder',
|
|
244
|
+
borderRadius: 'initial',
|
|
245
|
+
borderBottomLeftRadius: 'initial',
|
|
246
|
+
borderBottomRightRadius: 'initial',
|
|
247
|
+
boxShadow: 'none',
|
|
248
|
+
boxSizing: 'inherit',
|
|
249
|
+
position: 'relative',
|
|
250
|
+
right: 'inherit',
|
|
251
|
+
display: 'flex',
|
|
252
|
+
gap: 'revert',
|
|
253
|
+
transform: 'none',
|
|
254
|
+
outline: 'none',
|
|
255
|
+
backgroundColor: 'initial',
|
|
256
|
+
cursor: 'pointer',
|
|
257
|
+
color: 'red',
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
});
|
|
263
|
+
const accordionContentBase = style([
|
|
264
|
+
{
|
|
265
|
+
margin: '0',
|
|
266
|
+
fontSize: 'large',
|
|
267
|
+
border: 'Background',
|
|
268
|
+
borderRight: 'ActiveBorder',
|
|
269
|
+
borderLeft: 'ActiveBorder',
|
|
270
|
+
borderRadius: 'initial',
|
|
271
|
+
borderBottomLeftRadius: 'initial',
|
|
272
|
+
borderBottomRightRadius: 'initial',
|
|
273
|
+
boxShadow: 'none',
|
|
274
|
+
boxSizing: 'inherit',
|
|
275
|
+
position: 'relative',
|
|
276
|
+
right: 'inherit',
|
|
277
|
+
display: 'flex',
|
|
278
|
+
gap: 'revert',
|
|
279
|
+
transform: 'none',
|
|
280
|
+
outline: 'none',
|
|
281
|
+
backgroundColor: 'initial',
|
|
282
|
+
cursor: 'pointer',
|
|
283
|
+
color: 'red',
|
|
284
|
+
// The Safari rendering bug causes unwanted white space and a global scrollbar to appear when the neighbourhoods' filter accordion expands, incorrectly calculating the content boundaries. The transform: translateZ(0) fix forces Safari to create a new stacking context and properly contain the scrollable area within its defined boundaries, solving both issues.
|
|
285
|
+
// transform: theme.transforms.forceGpuAccelerate,
|
|
286
|
+
'@supports': {
|
|
287
|
+
'(hanging-punctuation: first) and (font: -apple-system-body) and (-webkit-appearance: none)': {
|
|
288
|
+
margin: '0',
|
|
289
|
+
fontSize: 'large',
|
|
290
|
+
border: 'Background',
|
|
291
|
+
borderRight: 'ActiveBorder',
|
|
292
|
+
borderLeft: 'ActiveBorder',
|
|
293
|
+
borderRadius: 'initial',
|
|
294
|
+
borderBottomLeftRadius: 'initial',
|
|
295
|
+
borderBottomRightRadius: 'initial',
|
|
296
|
+
boxShadow: 'none',
|
|
297
|
+
boxSizing: 'inherit',
|
|
298
|
+
position: 'relative',
|
|
299
|
+
right: 'inherit',
|
|
300
|
+
display: 'flex',
|
|
301
|
+
gap: 'revert',
|
|
302
|
+
transform: 'none',
|
|
303
|
+
outline: 'none',
|
|
304
|
+
backgroundColor: 'initial',
|
|
305
|
+
cursor: 'pointer',
|
|
306
|
+
color: 'red',
|
|
307
|
+
},
|
|
308
|
+
},
|
|
309
|
+
},
|
|
310
|
+
]);
|
|
311
|
+
export const accordionContent = recipe({
|
|
312
|
+
base: accordionContentBase,
|
|
313
|
+
variants: {
|
|
314
|
+
isOpen: {
|
|
315
|
+
false: {
|
|
316
|
+
margin: '0',
|
|
317
|
+
fontSize: 'large',
|
|
318
|
+
border: 'Background',
|
|
319
|
+
borderRight: 'ActiveBorder',
|
|
320
|
+
borderLeft: 'ActiveBorder',
|
|
321
|
+
borderRadius: 'initial',
|
|
322
|
+
borderBottomLeftRadius: 'initial',
|
|
323
|
+
borderBottomRightRadius: 'initial',
|
|
324
|
+
boxShadow: 'none',
|
|
325
|
+
boxSizing: 'inherit',
|
|
326
|
+
position: 'relative',
|
|
327
|
+
right: 'inherit',
|
|
328
|
+
display: 'flex',
|
|
329
|
+
gap: 'revert',
|
|
330
|
+
transform: 'none',
|
|
331
|
+
outline: 'none',
|
|
332
|
+
backgroundColor: 'initial',
|
|
333
|
+
cursor: 'pointer',
|
|
334
|
+
color: 'red',
|
|
335
|
+
},
|
|
336
|
+
true: {
|
|
337
|
+
margin: '0',
|
|
338
|
+
fontSize: 'large',
|
|
339
|
+
border: 'Background',
|
|
340
|
+
borderRight: 'ActiveBorder',
|
|
341
|
+
borderLeft: 'ActiveBorder',
|
|
342
|
+
borderRadius: 'initial',
|
|
343
|
+
borderBottomLeftRadius: 'initial',
|
|
344
|
+
borderBottomRightRadius: 'initial',
|
|
345
|
+
boxShadow: 'none',
|
|
346
|
+
boxSizing: 'inherit',
|
|
347
|
+
position: 'relative',
|
|
348
|
+
right: 'inherit',
|
|
349
|
+
display: 'flex',
|
|
350
|
+
gap: 'revert',
|
|
351
|
+
transform: 'none',
|
|
352
|
+
outline: 'none',
|
|
353
|
+
backgroundColor: 'initial',
|
|
354
|
+
cursor: 'pointer',
|
|
355
|
+
color: 'red',
|
|
356
|
+
':focus-visible': {
|
|
357
|
+
margin: '0',
|
|
358
|
+
fontSize: 'large',
|
|
359
|
+
border: 'Background',
|
|
360
|
+
borderRight: 'ActiveBorder',
|
|
361
|
+
borderLeft: 'ActiveBorder',
|
|
362
|
+
borderRadius: 'initial',
|
|
363
|
+
borderBottomLeftRadius: 'initial',
|
|
364
|
+
borderBottomRightRadius: 'initial',
|
|
365
|
+
boxShadow: 'none',
|
|
366
|
+
boxSizing: 'inherit',
|
|
367
|
+
position: 'relative',
|
|
368
|
+
right: 'inherit',
|
|
369
|
+
display: 'flex',
|
|
370
|
+
gap: 'revert',
|
|
371
|
+
transform: 'none',
|
|
372
|
+
outline: 'none',
|
|
373
|
+
backgroundColor: 'initial',
|
|
374
|
+
cursor: 'pointer',
|
|
375
|
+
color: 'red',
|
|
376
|
+
},
|
|
377
|
+
},
|
|
378
|
+
},
|
|
379
|
+
},
|
|
380
|
+
});
|
|
381
|
+
export const clearAllFiltersButton = style({
|
|
382
|
+
margin: '0',
|
|
383
|
+
fontSize: 'large',
|
|
384
|
+
border: 'Background',
|
|
385
|
+
borderRight: 'ActiveBorder',
|
|
386
|
+
borderLeft: 'ActiveBorder',
|
|
387
|
+
borderRadius: 'initial',
|
|
388
|
+
borderBottomLeftRadius: 'initial',
|
|
389
|
+
borderBottomRightRadius: 'initial',
|
|
390
|
+
boxShadow: 'none',
|
|
391
|
+
boxSizing: 'inherit',
|
|
392
|
+
position: 'relative',
|
|
393
|
+
right: 'inherit',
|
|
394
|
+
display: 'flex',
|
|
395
|
+
gap: 'revert',
|
|
396
|
+
transform: 'none',
|
|
397
|
+
outline: 'none',
|
|
398
|
+
backgroundColor: 'initial',
|
|
399
|
+
cursor: 'pointer',
|
|
400
|
+
color: 'red',
|
|
401
|
+
':hover': {
|
|
402
|
+
margin: '0',
|
|
403
|
+
fontSize: 'large',
|
|
404
|
+
border: 'Background',
|
|
405
|
+
borderRight: 'ActiveBorder',
|
|
406
|
+
borderLeft: 'ActiveBorder',
|
|
407
|
+
borderRadius: 'initial',
|
|
408
|
+
borderBottomLeftRadius: 'initial',
|
|
409
|
+
borderBottomRightRadius: 'initial',
|
|
410
|
+
boxShadow: 'none',
|
|
411
|
+
boxSizing: 'inherit',
|
|
412
|
+
position: 'relative',
|
|
413
|
+
right: 'inherit',
|
|
414
|
+
display: 'flex',
|
|
415
|
+
gap: 'revert',
|
|
416
|
+
transform: 'none',
|
|
417
|
+
outline: 'none',
|
|
418
|
+
backgroundColor: 'initial',
|
|
419
|
+
cursor: 'pointer',
|
|
420
|
+
color: 'red',
|
|
421
|
+
},
|
|
422
|
+
// These 2 prevent the content from overflowing the container in Brave when the accordion's open
|
|
423
|
+
// Safari, however, requires more - see accordionContentBase styles
|
|
424
|
+
':focus-visible': {
|
|
425
|
+
margin: '0',
|
|
426
|
+
fontSize: 'large',
|
|
427
|
+
border: 'Background',
|
|
428
|
+
borderRight: 'ActiveBorder',
|
|
429
|
+
borderLeft: 'ActiveBorder',
|
|
430
|
+
borderRadius: 'initial',
|
|
431
|
+
borderBottomLeftRadius: 'initial',
|
|
432
|
+
borderBottomRightRadius: 'initial',
|
|
433
|
+
boxShadow: 'none',
|
|
434
|
+
boxSizing: 'inherit',
|
|
435
|
+
position: 'relative',
|
|
436
|
+
right: 'inherit',
|
|
437
|
+
display: 'flex',
|
|
438
|
+
gap: 'revert',
|
|
439
|
+
transform: 'none',
|
|
440
|
+
outline: 'none',
|
|
441
|
+
backgroundColor: 'initial',
|
|
442
|
+
cursor: 'pointer',
|
|
443
|
+
color: 'red',
|
|
444
|
+
},
|
|
445
|
+
selectors: {
|
|
446
|
+
'&[data-pressed]': {
|
|
447
|
+
margin: '0',
|
|
448
|
+
fontSize: 'large',
|
|
449
|
+
border: 'Background',
|
|
450
|
+
borderRight: 'ActiveBorder',
|
|
451
|
+
borderLeft: 'ActiveBorder',
|
|
452
|
+
borderRadius: 'initial',
|
|
453
|
+
borderBottomLeftRadius: 'initial',
|
|
454
|
+
borderBottomRightRadius: 'initial',
|
|
455
|
+
boxShadow: 'none',
|
|
456
|
+
boxSizing: 'inherit',
|
|
457
|
+
position: 'relative',
|
|
458
|
+
right: 'inherit',
|
|
459
|
+
display: 'flex',
|
|
460
|
+
gap: 'revert',
|
|
461
|
+
transform: 'none',
|
|
462
|
+
outline: 'none',
|
|
463
|
+
backgroundColor: 'initial',
|
|
464
|
+
cursor: 'pointer',
|
|
465
|
+
color: 'red',
|
|
466
|
+
},
|
|
467
|
+
},
|
|
468
|
+
});
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { fontFace, globalFontFace, globalKeyframes, keyframes } from '@vanilla-extract/css';
|
|
2
|
+
export const rotate = keyframes({
|
|
3
|
+
'0%': {
|
|
4
|
+
backgroundColor: 'initial',
|
|
5
|
+
border: 'Background',
|
|
6
|
+
borderBottomLeftRadius: 'initial',
|
|
7
|
+
borderBottomRightRadius: 'initial',
|
|
8
|
+
borderLeft: 'ActiveBorder',
|
|
9
|
+
borderRadius: 'initial',
|
|
10
|
+
borderRight: 'ActiveBorder',
|
|
11
|
+
boxShadow: 'none',
|
|
12
|
+
boxSizing: 'inherit',
|
|
13
|
+
color: 'red',
|
|
14
|
+
cursor: 'pointer',
|
|
15
|
+
display: 'flex',
|
|
16
|
+
fontSize: 'large',
|
|
17
|
+
gap: 'revert',
|
|
18
|
+
margin: '0',
|
|
19
|
+
outline: 'none',
|
|
20
|
+
position: 'relative',
|
|
21
|
+
right: 'inherit',
|
|
22
|
+
transform: 'none',
|
|
23
|
+
},
|
|
24
|
+
'100%': {
|
|
25
|
+
backgroundColor: 'initial',
|
|
26
|
+
border: 'Background',
|
|
27
|
+
borderBottomLeftRadius: 'initial',
|
|
28
|
+
borderBottomRightRadius: 'initial',
|
|
29
|
+
borderLeft: 'ActiveBorder',
|
|
30
|
+
borderRadius: 'initial',
|
|
31
|
+
borderRight: 'ActiveBorder',
|
|
32
|
+
boxShadow: 'none',
|
|
33
|
+
boxSizing: 'inherit',
|
|
34
|
+
color: 'red',
|
|
35
|
+
cursor: 'pointer',
|
|
36
|
+
display: 'flex',
|
|
37
|
+
fontSize: 'large',
|
|
38
|
+
gap: 'revert',
|
|
39
|
+
margin: '0',
|
|
40
|
+
outline: 'none',
|
|
41
|
+
position: 'relative',
|
|
42
|
+
right: 'inherit',
|
|
43
|
+
transform: 'none',
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
export const spin = globalKeyframes('spin', {
|
|
47
|
+
from: {
|
|
48
|
+
backgroundColor: 'initial',
|
|
49
|
+
border: 'Background',
|
|
50
|
+
borderBottomLeftRadius: 'initial',
|
|
51
|
+
borderBottomRightRadius: 'initial',
|
|
52
|
+
borderLeft: 'ActiveBorder',
|
|
53
|
+
borderRadius: 'initial',
|
|
54
|
+
borderRight: 'ActiveBorder',
|
|
55
|
+
boxShadow: 'none',
|
|
56
|
+
boxSizing: 'inherit',
|
|
57
|
+
color: 'red',
|
|
58
|
+
cursor: 'pointer',
|
|
59
|
+
display: 'flex',
|
|
60
|
+
fontSize: 'large',
|
|
61
|
+
gap: 'revert',
|
|
62
|
+
margin: '0',
|
|
63
|
+
outline: 'none',
|
|
64
|
+
position: 'relative',
|
|
65
|
+
right: 'inherit',
|
|
66
|
+
transform: 'none',
|
|
67
|
+
},
|
|
68
|
+
to: {
|
|
69
|
+
backgroundColor: 'initial',
|
|
70
|
+
border: 'Background',
|
|
71
|
+
borderBottomLeftRadius: 'initial',
|
|
72
|
+
borderBottomRightRadius: 'initial',
|
|
73
|
+
borderLeft: 'ActiveBorder',
|
|
74
|
+
borderRadius: 'initial',
|
|
75
|
+
borderRight: 'ActiveBorder',
|
|
76
|
+
boxShadow: 'none',
|
|
77
|
+
boxSizing: 'inherit',
|
|
78
|
+
color: 'red',
|
|
79
|
+
cursor: 'pointer',
|
|
80
|
+
display: 'flex',
|
|
81
|
+
fontSize: 'large',
|
|
82
|
+
gap: 'revert',
|
|
83
|
+
margin: '0',
|
|
84
|
+
outline: 'none',
|
|
85
|
+
position: 'relative',
|
|
86
|
+
right: 'inherit',
|
|
87
|
+
transform: 'none',
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
export const myFont = fontFace({
|
|
91
|
+
fontWeight: 400,
|
|
92
|
+
src: 'url("/fonts/MyFont.woff2") format("woff2")',
|
|
93
|
+
fontStyle: 'normal',
|
|
94
|
+
fontDisplay: 'swap',
|
|
95
|
+
});
|
|
96
|
+
globalFontFace('GlobalFont', {
|
|
97
|
+
fontStretch: 'condensed',
|
|
98
|
+
fontWeight: 'bold',
|
|
99
|
+
src: 'local("Arial Bold")',
|
|
100
|
+
fontStyle: 'italic',
|
|
101
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Rule } from 'eslint';
|
|
2
|
+
import { TSESTree } from '@typescript-eslint/utils';
|
|
3
|
+
/**
|
|
4
|
+
* Enforces alphabetical ordering of CSS properties.
|
|
5
|
+
* @param ruleContext The ESLint rule context.
|
|
6
|
+
* @param regularProperties An array of regular CSS properties to be checked.
|
|
7
|
+
*
|
|
8
|
+
* This function does the following:
|
|
9
|
+
* 1. Checks if there are enough properties to compare (more than 1).
|
|
10
|
+
* 2. Creates pairs of consecutive properties for comparison.
|
|
11
|
+
* 3. Finds the first pair that violates alphabetical order.
|
|
12
|
+
* 4. If a violation is found, reports the issue and generates fixes.
|
|
13
|
+
*/
|
|
14
|
+
export declare const enforceAlphabeticalCSSOrder: (ruleContext: Rule.RuleContext, regularProperties: TSESTree.Property[]) => void;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { TSESTree } from '@typescript-eslint/utils';
|
|
2
|
+
import { generateFixesForCSSOrder } from '../shared-utils/css-order-fixer.js';
|
|
3
|
+
import { getPropertyName } from '../shared-utils/property-separator.js';
|
|
4
|
+
/**
|
|
5
|
+
* Compares two CSS properties alphabetically.
|
|
6
|
+
* @param firstProperty The first property to compare.
|
|
7
|
+
* @param secondProperty The second property to compare.
|
|
8
|
+
* @returns A number indicating the relative order of the properties (-1, 0, or 1).
|
|
9
|
+
*/
|
|
10
|
+
const comparePropertiesAlphabetically = (firstProperty, secondProperty) => {
|
|
11
|
+
const firstName = getPropertyName(firstProperty);
|
|
12
|
+
const secondName = getPropertyName(secondProperty);
|
|
13
|
+
return firstName.localeCompare(secondName);
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Reports an ordering issue to ESLint and generates fixes.
|
|
17
|
+
* @param ruleContext The ESLint rule context.
|
|
18
|
+
* @param currentProperty The current property in the order.
|
|
19
|
+
* @param nextProperty The next property that is out of order.
|
|
20
|
+
* @param regularProperties The full list of regular properties to be reordered.
|
|
21
|
+
*/
|
|
22
|
+
const reportOrderingIssue = (ruleContext, currentProperty, nextProperty, regularProperties) => {
|
|
23
|
+
ruleContext.report({
|
|
24
|
+
node: nextProperty,
|
|
25
|
+
messageId: 'alphabeticalOrder',
|
|
26
|
+
data: {
|
|
27
|
+
nextProperty: getPropertyName(nextProperty),
|
|
28
|
+
currentProperty: getPropertyName(currentProperty),
|
|
29
|
+
},
|
|
30
|
+
fix: (fixer) => generateFixesForCSSOrder(fixer, ruleContext, regularProperties, comparePropertiesAlphabetically, (property) => property),
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Enforces alphabetical ordering of CSS properties.
|
|
35
|
+
* @param ruleContext The ESLint rule context.
|
|
36
|
+
* @param regularProperties An array of regular CSS properties to be checked.
|
|
37
|
+
*
|
|
38
|
+
* This function does the following:
|
|
39
|
+
* 1. Checks if there are enough properties to compare (more than 1).
|
|
40
|
+
* 2. Creates pairs of consecutive properties for comparison.
|
|
41
|
+
* 3. Finds the first pair that violates alphabetical order.
|
|
42
|
+
* 4. If a violation is found, reports the issue and generates fixes.
|
|
43
|
+
*/
|
|
44
|
+
export const enforceAlphabeticalCSSOrder = (ruleContext, regularProperties) => {
|
|
45
|
+
if (regularProperties.length <= 1) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
// Create pairs of consecutive properties
|
|
49
|
+
const propertyPairs = regularProperties.slice(0, -1).map((currentProperty, index) => ({
|
|
50
|
+
currentProperty,
|
|
51
|
+
nextProperty: regularProperties[index + 1],
|
|
52
|
+
}));
|
|
53
|
+
const violatingPair = propertyPairs.find(({ currentProperty, nextProperty }) => comparePropertiesAlphabetically(currentProperty, nextProperty) > 0);
|
|
54
|
+
if (violatingPair) {
|
|
55
|
+
reportOrderingIssue(ruleContext, violatingPair.currentProperty, violatingPair.nextProperty, regularProperties);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Rule } from 'eslint';
|
|
2
|
+
import { TSESTree } from '@typescript-eslint/utils';
|
|
3
|
+
/**
|
|
4
|
+
* Enforces alphabetical ordering of CSS properties within a recipe function call.
|
|
5
|
+
*
|
|
6
|
+
* @param node The CallExpression node representing the recipe function call.
|
|
7
|
+
* @param context The ESLint rule context.
|
|
8
|
+
*
|
|
9
|
+
* This function does the following:
|
|
10
|
+
* 1. Checks if the first argument of the recipe function is an ObjectExpression.
|
|
11
|
+
* 2. If valid, processes the recipe object's properties.
|
|
12
|
+
* 3. For each relevant property (e.g., 'base', 'variants'), it applies alphabetical ordering to the CSS properties.
|
|
13
|
+
*/
|
|
14
|
+
export declare const enforceAlphabeticalCSSOrderInRecipe: (node: TSESTree.CallExpression, context: Rule.RuleContext) => void;
|