@tenphi/eslint-plugin-tasty 0.1.0
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 +117 -0
- package/dist/_virtual/_rolldown/runtime.mjs +7 -0
- package/dist/config.mjs +118 -0
- package/dist/config.mjs.map +1 -0
- package/dist/configs.d.mts +8 -0
- package/dist/configs.mjs +36 -0
- package/dist/configs.mjs.map +1 -0
- package/dist/constants.mjs +700 -0
- package/dist/constants.mjs.map +1 -0
- package/dist/context.mjs +180 -0
- package/dist/context.mjs.map +1 -0
- package/dist/create-rule.mjs +8 -0
- package/dist/create-rule.mjs.map +1 -0
- package/dist/index.d.mts +8 -0
- package/dist/index.mjs +83 -0
- package/dist/index.mjs.map +1 -0
- package/dist/parser.mjs +46 -0
- package/dist/parser.mjs.map +1 -0
- package/dist/property-expectations.mjs +168 -0
- package/dist/property-expectations.mjs.map +1 -0
- package/dist/rules/consistent-token-usage.mjs +88 -0
- package/dist/rules/consistent-token-usage.mjs.map +1 -0
- package/dist/rules/known-property.mjs +55 -0
- package/dist/rules/known-property.mjs.map +1 -0
- package/dist/rules/no-duplicate-state.mjs +51 -0
- package/dist/rules/no-duplicate-state.mjs.map +1 -0
- package/dist/rules/no-important.mjs +44 -0
- package/dist/rules/no-important.mjs.map +1 -0
- package/dist/rules/no-nested-selector.mjs +40 -0
- package/dist/rules/no-nested-selector.mjs.map +1 -0
- package/dist/rules/no-nested-state-map.mjs +44 -0
- package/dist/rules/no-nested-state-map.mjs.map +1 -0
- package/dist/rules/no-raw-color-values.mjs +84 -0
- package/dist/rules/no-raw-color-values.mjs.map +1 -0
- package/dist/rules/no-runtime-styles-mutation.mjs +52 -0
- package/dist/rules/no-runtime-styles-mutation.mjs.map +1 -0
- package/dist/rules/no-styles-prop.mjs +25 -0
- package/dist/rules/no-styles-prop.mjs.map +1 -0
- package/dist/rules/no-unknown-state-alias.mjs +49 -0
- package/dist/rules/no-unknown-state-alias.mjs.map +1 -0
- package/dist/rules/prefer-shorthand-property.mjs +45 -0
- package/dist/rules/prefer-shorthand-property.mjs.map +1 -0
- package/dist/rules/require-default-state.mjs +47 -0
- package/dist/rules/require-default-state.mjs.map +1 -0
- package/dist/rules/static-no-dynamic-values.mjs +54 -0
- package/dist/rules/static-no-dynamic-values.mjs.map +1 -0
- package/dist/rules/static-valid-selector.mjs +51 -0
- package/dist/rules/static-valid-selector.mjs.map +1 -0
- package/dist/rules/valid-boolean-property.mjs +45 -0
- package/dist/rules/valid-boolean-property.mjs.map +1 -0
- package/dist/rules/valid-color-token.mjs +84 -0
- package/dist/rules/valid-color-token.mjs.map +1 -0
- package/dist/rules/valid-custom-property.mjs +69 -0
- package/dist/rules/valid-custom-property.mjs.map +1 -0
- package/dist/rules/valid-custom-unit.mjs +62 -0
- package/dist/rules/valid-custom-unit.mjs.map +1 -0
- package/dist/rules/valid-directional-modifier.mjs +71 -0
- package/dist/rules/valid-directional-modifier.mjs.map +1 -0
- package/dist/rules/valid-preset.mjs +64 -0
- package/dist/rules/valid-preset.mjs.map +1 -0
- package/dist/rules/valid-radius-shape.mjs +77 -0
- package/dist/rules/valid-radius-shape.mjs.map +1 -0
- package/dist/rules/valid-recipe.mjs +51 -0
- package/dist/rules/valid-recipe.mjs.map +1 -0
- package/dist/rules/valid-state-key.mjs +71 -0
- package/dist/rules/valid-state-key.mjs.map +1 -0
- package/dist/rules/valid-styles-structure.mjs +79 -0
- package/dist/rules/valid-styles-structure.mjs.map +1 -0
- package/dist/rules/valid-sub-element.mjs +46 -0
- package/dist/rules/valid-sub-element.mjs.map +1 -0
- package/dist/rules/valid-transition.mjs +62 -0
- package/dist/rules/valid-transition.mjs.map +1 -0
- package/dist/rules/valid-value.mjs +123 -0
- package/dist/rules/valid-value.mjs.map +1 -0
- package/dist/types.d.mts +25 -0
- package/dist/utils.mjs +152 -0
- package/dist/utils.mjs.map +1 -0
- package/package.json +90 -0
|
@@ -0,0 +1,700 @@
|
|
|
1
|
+
//#region src/constants.ts
|
|
2
|
+
/**
|
|
3
|
+
* Built-in tasty style properties that are always valid as style keys.
|
|
4
|
+
*/
|
|
5
|
+
const KNOWN_TASTY_PROPERTIES = new Set([
|
|
6
|
+
"display",
|
|
7
|
+
"font",
|
|
8
|
+
"preset",
|
|
9
|
+
"hide",
|
|
10
|
+
"whiteSpace",
|
|
11
|
+
"opacity",
|
|
12
|
+
"transition",
|
|
13
|
+
"gridArea",
|
|
14
|
+
"order",
|
|
15
|
+
"gridColumn",
|
|
16
|
+
"gridRow",
|
|
17
|
+
"placeSelf",
|
|
18
|
+
"alignSelf",
|
|
19
|
+
"justifySelf",
|
|
20
|
+
"zIndex",
|
|
21
|
+
"margin",
|
|
22
|
+
"inset",
|
|
23
|
+
"position",
|
|
24
|
+
"padding",
|
|
25
|
+
"paddingInline",
|
|
26
|
+
"paddingBlock",
|
|
27
|
+
"overflow",
|
|
28
|
+
"scrollbar",
|
|
29
|
+
"textAlign",
|
|
30
|
+
"border",
|
|
31
|
+
"radius",
|
|
32
|
+
"shadow",
|
|
33
|
+
"outline",
|
|
34
|
+
"color",
|
|
35
|
+
"fill",
|
|
36
|
+
"fade",
|
|
37
|
+
"image",
|
|
38
|
+
"textTransform",
|
|
39
|
+
"fontWeight",
|
|
40
|
+
"fontStyle",
|
|
41
|
+
"width",
|
|
42
|
+
"height",
|
|
43
|
+
"flexBasis",
|
|
44
|
+
"flexGrow",
|
|
45
|
+
"flexShrink",
|
|
46
|
+
"flex",
|
|
47
|
+
"flow",
|
|
48
|
+
"placeItems",
|
|
49
|
+
"placeContent",
|
|
50
|
+
"alignItems",
|
|
51
|
+
"alignContent",
|
|
52
|
+
"justifyItems",
|
|
53
|
+
"justifyContent",
|
|
54
|
+
"align",
|
|
55
|
+
"justify",
|
|
56
|
+
"gap",
|
|
57
|
+
"columnGap",
|
|
58
|
+
"rowGap",
|
|
59
|
+
"gridColumns",
|
|
60
|
+
"gridRows",
|
|
61
|
+
"gridTemplate",
|
|
62
|
+
"gridAreas",
|
|
63
|
+
"recipe",
|
|
64
|
+
"textOverflow",
|
|
65
|
+
"textDecoration",
|
|
66
|
+
"animation",
|
|
67
|
+
"cursor",
|
|
68
|
+
"pointerEvents",
|
|
69
|
+
"userSelect",
|
|
70
|
+
"transform",
|
|
71
|
+
"transformOrigin",
|
|
72
|
+
"filter",
|
|
73
|
+
"backdropFilter",
|
|
74
|
+
"mixBlendMode",
|
|
75
|
+
"objectFit",
|
|
76
|
+
"objectPosition",
|
|
77
|
+
"resize",
|
|
78
|
+
"appearance",
|
|
79
|
+
"listStyle",
|
|
80
|
+
"listStyleType",
|
|
81
|
+
"content",
|
|
82
|
+
"boxSizing",
|
|
83
|
+
"verticalAlign",
|
|
84
|
+
"wordBreak",
|
|
85
|
+
"overflowWrap",
|
|
86
|
+
"hyphens",
|
|
87
|
+
"tabSize",
|
|
88
|
+
"direction",
|
|
89
|
+
"unicodeBidi",
|
|
90
|
+
"writingMode",
|
|
91
|
+
"lineClamp",
|
|
92
|
+
"aspectRatio",
|
|
93
|
+
"contain",
|
|
94
|
+
"containerType",
|
|
95
|
+
"containerName",
|
|
96
|
+
"willChange",
|
|
97
|
+
"isolation",
|
|
98
|
+
"touchAction",
|
|
99
|
+
"scrollBehavior",
|
|
100
|
+
"scrollSnapType",
|
|
101
|
+
"scrollSnapAlign",
|
|
102
|
+
"caretColor",
|
|
103
|
+
"accentColor",
|
|
104
|
+
"colorScheme"
|
|
105
|
+
]);
|
|
106
|
+
/**
|
|
107
|
+
* Special top-level keys that are valid but not regular style properties.
|
|
108
|
+
*/
|
|
109
|
+
const SPECIAL_STYLE_KEYS = new Set(["@keyframes", "@properties"]);
|
|
110
|
+
/**
|
|
111
|
+
* CSS property names (common subset for validation).
|
|
112
|
+
* When a key is camelCase and matches a known CSS property, it's valid.
|
|
113
|
+
*/
|
|
114
|
+
const KNOWN_CSS_PROPERTIES = new Set([
|
|
115
|
+
"all",
|
|
116
|
+
"animation",
|
|
117
|
+
"animationDelay",
|
|
118
|
+
"animationDirection",
|
|
119
|
+
"animationDuration",
|
|
120
|
+
"animationFillMode",
|
|
121
|
+
"animationIterationCount",
|
|
122
|
+
"animationName",
|
|
123
|
+
"animationPlayState",
|
|
124
|
+
"animationTimingFunction",
|
|
125
|
+
"appearance",
|
|
126
|
+
"aspectRatio",
|
|
127
|
+
"backdropFilter",
|
|
128
|
+
"backfaceVisibility",
|
|
129
|
+
"background",
|
|
130
|
+
"backgroundAttachment",
|
|
131
|
+
"backgroundBlendMode",
|
|
132
|
+
"backgroundClip",
|
|
133
|
+
"backgroundColor",
|
|
134
|
+
"backgroundImage",
|
|
135
|
+
"backgroundOrigin",
|
|
136
|
+
"backgroundPosition",
|
|
137
|
+
"backgroundRepeat",
|
|
138
|
+
"backgroundSize",
|
|
139
|
+
"blockSize",
|
|
140
|
+
"border",
|
|
141
|
+
"borderBlock",
|
|
142
|
+
"borderBlockColor",
|
|
143
|
+
"borderBlockEnd",
|
|
144
|
+
"borderBlockEndColor",
|
|
145
|
+
"borderBlockEndStyle",
|
|
146
|
+
"borderBlockEndWidth",
|
|
147
|
+
"borderBlockStart",
|
|
148
|
+
"borderBlockStartColor",
|
|
149
|
+
"borderBlockStartStyle",
|
|
150
|
+
"borderBlockStartWidth",
|
|
151
|
+
"borderBlockStyle",
|
|
152
|
+
"borderBlockWidth",
|
|
153
|
+
"borderBottom",
|
|
154
|
+
"borderBottomColor",
|
|
155
|
+
"borderBottomLeftRadius",
|
|
156
|
+
"borderBottomRightRadius",
|
|
157
|
+
"borderBottomStyle",
|
|
158
|
+
"borderBottomWidth",
|
|
159
|
+
"borderCollapse",
|
|
160
|
+
"borderColor",
|
|
161
|
+
"borderImage",
|
|
162
|
+
"borderInline",
|
|
163
|
+
"borderInlineColor",
|
|
164
|
+
"borderInlineEnd",
|
|
165
|
+
"borderInlineStart",
|
|
166
|
+
"borderInlineStyle",
|
|
167
|
+
"borderInlineWidth",
|
|
168
|
+
"borderLeft",
|
|
169
|
+
"borderLeftColor",
|
|
170
|
+
"borderLeftStyle",
|
|
171
|
+
"borderLeftWidth",
|
|
172
|
+
"borderRadius",
|
|
173
|
+
"borderRight",
|
|
174
|
+
"borderRightColor",
|
|
175
|
+
"borderRightStyle",
|
|
176
|
+
"borderRightWidth",
|
|
177
|
+
"borderSpacing",
|
|
178
|
+
"borderStyle",
|
|
179
|
+
"borderTop",
|
|
180
|
+
"borderTopColor",
|
|
181
|
+
"borderTopLeftRadius",
|
|
182
|
+
"borderTopRightRadius",
|
|
183
|
+
"borderTopStyle",
|
|
184
|
+
"borderTopWidth",
|
|
185
|
+
"borderWidth",
|
|
186
|
+
"bottom",
|
|
187
|
+
"boxDecorationBreak",
|
|
188
|
+
"boxShadow",
|
|
189
|
+
"boxSizing",
|
|
190
|
+
"breakAfter",
|
|
191
|
+
"breakBefore",
|
|
192
|
+
"breakInside",
|
|
193
|
+
"captionSide",
|
|
194
|
+
"caretColor",
|
|
195
|
+
"clear",
|
|
196
|
+
"clip",
|
|
197
|
+
"clipPath",
|
|
198
|
+
"color",
|
|
199
|
+
"colorScheme",
|
|
200
|
+
"columnCount",
|
|
201
|
+
"columnFill",
|
|
202
|
+
"columnGap",
|
|
203
|
+
"columnRule",
|
|
204
|
+
"columnRuleColor",
|
|
205
|
+
"columnRuleStyle",
|
|
206
|
+
"columnRuleWidth",
|
|
207
|
+
"columnSpan",
|
|
208
|
+
"columnWidth",
|
|
209
|
+
"columns",
|
|
210
|
+
"contain",
|
|
211
|
+
"containerName",
|
|
212
|
+
"containerType",
|
|
213
|
+
"content",
|
|
214
|
+
"contentVisibility",
|
|
215
|
+
"counterIncrement",
|
|
216
|
+
"counterReset",
|
|
217
|
+
"counterSet",
|
|
218
|
+
"cursor",
|
|
219
|
+
"direction",
|
|
220
|
+
"display",
|
|
221
|
+
"emptyCells",
|
|
222
|
+
"filter",
|
|
223
|
+
"flex",
|
|
224
|
+
"flexBasis",
|
|
225
|
+
"flexDirection",
|
|
226
|
+
"flexFlow",
|
|
227
|
+
"flexGrow",
|
|
228
|
+
"flexShrink",
|
|
229
|
+
"flexWrap",
|
|
230
|
+
"float",
|
|
231
|
+
"font",
|
|
232
|
+
"fontFamily",
|
|
233
|
+
"fontFeatureSettings",
|
|
234
|
+
"fontKerning",
|
|
235
|
+
"fontOpticalSizing",
|
|
236
|
+
"fontSize",
|
|
237
|
+
"fontSizeAdjust",
|
|
238
|
+
"fontStretch",
|
|
239
|
+
"fontStyle",
|
|
240
|
+
"fontSynthesis",
|
|
241
|
+
"fontVariant",
|
|
242
|
+
"fontVariantAlternates",
|
|
243
|
+
"fontVariantCaps",
|
|
244
|
+
"fontVariantEastAsian",
|
|
245
|
+
"fontVariantLigatures",
|
|
246
|
+
"fontVariantNumeric",
|
|
247
|
+
"fontVariantPosition",
|
|
248
|
+
"fontWeight",
|
|
249
|
+
"gap",
|
|
250
|
+
"grid",
|
|
251
|
+
"gridArea",
|
|
252
|
+
"gridAutoColumns",
|
|
253
|
+
"gridAutoFlow",
|
|
254
|
+
"gridAutoRows",
|
|
255
|
+
"gridColumn",
|
|
256
|
+
"gridColumnEnd",
|
|
257
|
+
"gridColumnStart",
|
|
258
|
+
"gridRow",
|
|
259
|
+
"gridRowEnd",
|
|
260
|
+
"gridRowStart",
|
|
261
|
+
"gridTemplate",
|
|
262
|
+
"gridTemplateAreas",
|
|
263
|
+
"gridTemplateColumns",
|
|
264
|
+
"gridTemplateRows",
|
|
265
|
+
"height",
|
|
266
|
+
"hyphens",
|
|
267
|
+
"imageRendering",
|
|
268
|
+
"inlineSize",
|
|
269
|
+
"inset",
|
|
270
|
+
"insetBlock",
|
|
271
|
+
"insetBlockEnd",
|
|
272
|
+
"insetBlockStart",
|
|
273
|
+
"insetInline",
|
|
274
|
+
"insetInlineEnd",
|
|
275
|
+
"insetInlineStart",
|
|
276
|
+
"isolation",
|
|
277
|
+
"justifyContent",
|
|
278
|
+
"justifyItems",
|
|
279
|
+
"justifySelf",
|
|
280
|
+
"left",
|
|
281
|
+
"letterSpacing",
|
|
282
|
+
"lineBreak",
|
|
283
|
+
"lineHeight",
|
|
284
|
+
"listStyle",
|
|
285
|
+
"listStyleImage",
|
|
286
|
+
"listStylePosition",
|
|
287
|
+
"listStyleType",
|
|
288
|
+
"margin",
|
|
289
|
+
"marginBlock",
|
|
290
|
+
"marginBlockEnd",
|
|
291
|
+
"marginBlockStart",
|
|
292
|
+
"marginBottom",
|
|
293
|
+
"marginInline",
|
|
294
|
+
"marginInlineEnd",
|
|
295
|
+
"marginInlineStart",
|
|
296
|
+
"marginLeft",
|
|
297
|
+
"marginRight",
|
|
298
|
+
"marginTop",
|
|
299
|
+
"maskImage",
|
|
300
|
+
"maxBlockSize",
|
|
301
|
+
"maxHeight",
|
|
302
|
+
"maxInlineSize",
|
|
303
|
+
"maxWidth",
|
|
304
|
+
"minBlockSize",
|
|
305
|
+
"minHeight",
|
|
306
|
+
"minInlineSize",
|
|
307
|
+
"minWidth",
|
|
308
|
+
"mixBlendMode",
|
|
309
|
+
"objectFit",
|
|
310
|
+
"objectPosition",
|
|
311
|
+
"opacity",
|
|
312
|
+
"order",
|
|
313
|
+
"orphans",
|
|
314
|
+
"outline",
|
|
315
|
+
"outlineColor",
|
|
316
|
+
"outlineOffset",
|
|
317
|
+
"outlineStyle",
|
|
318
|
+
"outlineWidth",
|
|
319
|
+
"overflow",
|
|
320
|
+
"overflowAnchor",
|
|
321
|
+
"overflowWrap",
|
|
322
|
+
"overflowX",
|
|
323
|
+
"overflowY",
|
|
324
|
+
"overscrollBehavior",
|
|
325
|
+
"padding",
|
|
326
|
+
"paddingBlock",
|
|
327
|
+
"paddingBlockEnd",
|
|
328
|
+
"paddingBlockStart",
|
|
329
|
+
"paddingBottom",
|
|
330
|
+
"paddingInline",
|
|
331
|
+
"paddingInlineEnd",
|
|
332
|
+
"paddingInlineStart",
|
|
333
|
+
"paddingLeft",
|
|
334
|
+
"paddingRight",
|
|
335
|
+
"paddingTop",
|
|
336
|
+
"perspective",
|
|
337
|
+
"perspectiveOrigin",
|
|
338
|
+
"placeContent",
|
|
339
|
+
"placeItems",
|
|
340
|
+
"placeSelf",
|
|
341
|
+
"pointerEvents",
|
|
342
|
+
"position",
|
|
343
|
+
"quotes",
|
|
344
|
+
"resize",
|
|
345
|
+
"right",
|
|
346
|
+
"rotate",
|
|
347
|
+
"rowGap",
|
|
348
|
+
"scale",
|
|
349
|
+
"scrollBehavior",
|
|
350
|
+
"scrollMargin",
|
|
351
|
+
"scrollPadding",
|
|
352
|
+
"scrollSnapAlign",
|
|
353
|
+
"scrollSnapStop",
|
|
354
|
+
"scrollSnapType",
|
|
355
|
+
"scrollbarColor",
|
|
356
|
+
"scrollbarGutter",
|
|
357
|
+
"scrollbarWidth",
|
|
358
|
+
"shapeOutside",
|
|
359
|
+
"tabSize",
|
|
360
|
+
"tableLayout",
|
|
361
|
+
"textAlign",
|
|
362
|
+
"textAlignLast",
|
|
363
|
+
"textCombineUpright",
|
|
364
|
+
"textDecoration",
|
|
365
|
+
"textDecorationColor",
|
|
366
|
+
"textDecorationLine",
|
|
367
|
+
"textDecorationSkipInk",
|
|
368
|
+
"textDecorationStyle",
|
|
369
|
+
"textDecorationThickness",
|
|
370
|
+
"textEmphasis",
|
|
371
|
+
"textIndent",
|
|
372
|
+
"textOrientation",
|
|
373
|
+
"textOverflow",
|
|
374
|
+
"textRendering",
|
|
375
|
+
"textShadow",
|
|
376
|
+
"textTransform",
|
|
377
|
+
"textUnderlineOffset",
|
|
378
|
+
"textUnderlinePosition",
|
|
379
|
+
"textWrap",
|
|
380
|
+
"top",
|
|
381
|
+
"touchAction",
|
|
382
|
+
"transform",
|
|
383
|
+
"transformOrigin",
|
|
384
|
+
"transformStyle",
|
|
385
|
+
"transition",
|
|
386
|
+
"transitionDelay",
|
|
387
|
+
"transitionDuration",
|
|
388
|
+
"transitionProperty",
|
|
389
|
+
"transitionTimingFunction",
|
|
390
|
+
"translate",
|
|
391
|
+
"unicodeBidi",
|
|
392
|
+
"userSelect",
|
|
393
|
+
"verticalAlign",
|
|
394
|
+
"visibility",
|
|
395
|
+
"whiteSpace",
|
|
396
|
+
"widows",
|
|
397
|
+
"width",
|
|
398
|
+
"willChange",
|
|
399
|
+
"wordBreak",
|
|
400
|
+
"wordSpacing",
|
|
401
|
+
"writingMode",
|
|
402
|
+
"zIndex"
|
|
403
|
+
]);
|
|
404
|
+
/**
|
|
405
|
+
* Built-in custom units recognized by the tasty parser.
|
|
406
|
+
*/
|
|
407
|
+
const BUILT_IN_UNITS = new Set([
|
|
408
|
+
"x",
|
|
409
|
+
"r",
|
|
410
|
+
"cr",
|
|
411
|
+
"bw",
|
|
412
|
+
"ow",
|
|
413
|
+
"fs",
|
|
414
|
+
"lh",
|
|
415
|
+
"sf"
|
|
416
|
+
]);
|
|
417
|
+
/**
|
|
418
|
+
* Standard CSS units (always valid).
|
|
419
|
+
*/
|
|
420
|
+
const CSS_UNITS = new Set([
|
|
421
|
+
"px",
|
|
422
|
+
"em",
|
|
423
|
+
"rem",
|
|
424
|
+
"%",
|
|
425
|
+
"vw",
|
|
426
|
+
"vh",
|
|
427
|
+
"vmin",
|
|
428
|
+
"vmax",
|
|
429
|
+
"ch",
|
|
430
|
+
"ex",
|
|
431
|
+
"cm",
|
|
432
|
+
"mm",
|
|
433
|
+
"in",
|
|
434
|
+
"pt",
|
|
435
|
+
"pc",
|
|
436
|
+
"fr",
|
|
437
|
+
"deg",
|
|
438
|
+
"rad",
|
|
439
|
+
"turn",
|
|
440
|
+
"grad",
|
|
441
|
+
"s",
|
|
442
|
+
"ms",
|
|
443
|
+
"dpi",
|
|
444
|
+
"dpcm",
|
|
445
|
+
"dppx",
|
|
446
|
+
"svw",
|
|
447
|
+
"svh",
|
|
448
|
+
"lvw",
|
|
449
|
+
"lvh",
|
|
450
|
+
"dvw",
|
|
451
|
+
"dvh",
|
|
452
|
+
"cqw",
|
|
453
|
+
"cqh",
|
|
454
|
+
"cqi",
|
|
455
|
+
"cqb",
|
|
456
|
+
"cqmin",
|
|
457
|
+
"cqmax",
|
|
458
|
+
"cap",
|
|
459
|
+
"ic",
|
|
460
|
+
"rlh",
|
|
461
|
+
"vi",
|
|
462
|
+
"vb"
|
|
463
|
+
]);
|
|
464
|
+
/**
|
|
465
|
+
* Properties that accept `true` as a value (means "use default").
|
|
466
|
+
*/
|
|
467
|
+
const BOOLEAN_TRUE_PROPERTIES = new Set([
|
|
468
|
+
"border",
|
|
469
|
+
"radius",
|
|
470
|
+
"padding",
|
|
471
|
+
"gap",
|
|
472
|
+
"fill",
|
|
473
|
+
"color",
|
|
474
|
+
"outline",
|
|
475
|
+
"width",
|
|
476
|
+
"height",
|
|
477
|
+
"hide",
|
|
478
|
+
"preset",
|
|
479
|
+
"font",
|
|
480
|
+
"scrollbar"
|
|
481
|
+
]);
|
|
482
|
+
/**
|
|
483
|
+
* Directional modifiers and which properties accept them.
|
|
484
|
+
*/
|
|
485
|
+
const DIRECTIONAL_MODIFIERS = {
|
|
486
|
+
border: new Set([
|
|
487
|
+
"top",
|
|
488
|
+
"right",
|
|
489
|
+
"bottom",
|
|
490
|
+
"left"
|
|
491
|
+
]),
|
|
492
|
+
radius: new Set([
|
|
493
|
+
"top",
|
|
494
|
+
"right",
|
|
495
|
+
"bottom",
|
|
496
|
+
"left",
|
|
497
|
+
"top-left",
|
|
498
|
+
"top-right",
|
|
499
|
+
"bottom-left",
|
|
500
|
+
"bottom-right"
|
|
501
|
+
]),
|
|
502
|
+
padding: new Set([
|
|
503
|
+
"top",
|
|
504
|
+
"right",
|
|
505
|
+
"bottom",
|
|
506
|
+
"left"
|
|
507
|
+
]),
|
|
508
|
+
margin: new Set([
|
|
509
|
+
"top",
|
|
510
|
+
"right",
|
|
511
|
+
"bottom",
|
|
512
|
+
"left"
|
|
513
|
+
]),
|
|
514
|
+
fade: new Set([
|
|
515
|
+
"top",
|
|
516
|
+
"right",
|
|
517
|
+
"bottom",
|
|
518
|
+
"left"
|
|
519
|
+
])
|
|
520
|
+
};
|
|
521
|
+
/**
|
|
522
|
+
* Valid radius shape keywords.
|
|
523
|
+
*/
|
|
524
|
+
const RADIUS_SHAPES = new Set([
|
|
525
|
+
"round",
|
|
526
|
+
"ellipse",
|
|
527
|
+
"leaf",
|
|
528
|
+
"backleaf"
|
|
529
|
+
]);
|
|
530
|
+
/**
|
|
531
|
+
* Known semantic transition names.
|
|
532
|
+
*/
|
|
533
|
+
const SEMANTIC_TRANSITIONS = new Set([
|
|
534
|
+
"fade",
|
|
535
|
+
"fill",
|
|
536
|
+
"border",
|
|
537
|
+
"radius",
|
|
538
|
+
"shadow",
|
|
539
|
+
"preset",
|
|
540
|
+
"gap",
|
|
541
|
+
"theme",
|
|
542
|
+
"color",
|
|
543
|
+
"outline",
|
|
544
|
+
"dimension",
|
|
545
|
+
"flow",
|
|
546
|
+
"inset"
|
|
547
|
+
]);
|
|
548
|
+
/**
|
|
549
|
+
* Mapping of native CSS properties to tasty shorthand alternatives.
|
|
550
|
+
*/
|
|
551
|
+
const SHORTHAND_MAPPING = {
|
|
552
|
+
backgroundColor: {
|
|
553
|
+
property: "fill",
|
|
554
|
+
hint: "fill: '...'"
|
|
555
|
+
},
|
|
556
|
+
borderColor: {
|
|
557
|
+
property: "border",
|
|
558
|
+
hint: "border: '...'"
|
|
559
|
+
},
|
|
560
|
+
borderWidth: {
|
|
561
|
+
property: "border",
|
|
562
|
+
hint: "border: '...'"
|
|
563
|
+
},
|
|
564
|
+
borderStyle: {
|
|
565
|
+
property: "border",
|
|
566
|
+
hint: "border: '...'"
|
|
567
|
+
},
|
|
568
|
+
borderTop: {
|
|
569
|
+
property: "border",
|
|
570
|
+
hint: "border: '... top'"
|
|
571
|
+
},
|
|
572
|
+
borderRight: {
|
|
573
|
+
property: "border",
|
|
574
|
+
hint: "border: '... right'"
|
|
575
|
+
},
|
|
576
|
+
borderBottom: {
|
|
577
|
+
property: "border",
|
|
578
|
+
hint: "border: '... bottom'"
|
|
579
|
+
},
|
|
580
|
+
borderLeft: {
|
|
581
|
+
property: "border",
|
|
582
|
+
hint: "border: '... left'"
|
|
583
|
+
},
|
|
584
|
+
borderRadius: {
|
|
585
|
+
property: "radius",
|
|
586
|
+
hint: "radius: '...'"
|
|
587
|
+
},
|
|
588
|
+
maxWidth: {
|
|
589
|
+
property: "width",
|
|
590
|
+
hint: "width: 'max ...'"
|
|
591
|
+
},
|
|
592
|
+
minWidth: {
|
|
593
|
+
property: "width",
|
|
594
|
+
hint: "width: 'min ...'"
|
|
595
|
+
},
|
|
596
|
+
maxHeight: {
|
|
597
|
+
property: "height",
|
|
598
|
+
hint: "height: 'max ...'"
|
|
599
|
+
},
|
|
600
|
+
minHeight: {
|
|
601
|
+
property: "height",
|
|
602
|
+
hint: "height: 'min ...'"
|
|
603
|
+
},
|
|
604
|
+
flexDirection: {
|
|
605
|
+
property: "flow",
|
|
606
|
+
hint: "flow: '...'"
|
|
607
|
+
},
|
|
608
|
+
flexWrap: {
|
|
609
|
+
property: "flow",
|
|
610
|
+
hint: "flow: '...'"
|
|
611
|
+
},
|
|
612
|
+
flexFlow: {
|
|
613
|
+
property: "flow",
|
|
614
|
+
hint: "flow: '...'"
|
|
615
|
+
},
|
|
616
|
+
gridAutoFlow: {
|
|
617
|
+
property: "flow",
|
|
618
|
+
hint: "flow: '...'"
|
|
619
|
+
},
|
|
620
|
+
outlineOffset: {
|
|
621
|
+
property: "outline",
|
|
622
|
+
hint: "outline: '... / offset'"
|
|
623
|
+
},
|
|
624
|
+
paddingTop: {
|
|
625
|
+
property: "padding",
|
|
626
|
+
hint: "padding: '... top'"
|
|
627
|
+
},
|
|
628
|
+
paddingRight: {
|
|
629
|
+
property: "padding",
|
|
630
|
+
hint: "padding: '... right'"
|
|
631
|
+
},
|
|
632
|
+
paddingBottom: {
|
|
633
|
+
property: "padding",
|
|
634
|
+
hint: "padding: '... bottom'"
|
|
635
|
+
},
|
|
636
|
+
paddingLeft: {
|
|
637
|
+
property: "padding",
|
|
638
|
+
hint: "padding: '... left'"
|
|
639
|
+
},
|
|
640
|
+
marginTop: {
|
|
641
|
+
property: "margin",
|
|
642
|
+
hint: "margin: '... top'"
|
|
643
|
+
},
|
|
644
|
+
marginRight: {
|
|
645
|
+
property: "margin",
|
|
646
|
+
hint: "margin: '... right'"
|
|
647
|
+
},
|
|
648
|
+
marginBottom: {
|
|
649
|
+
property: "margin",
|
|
650
|
+
hint: "margin: '... bottom'"
|
|
651
|
+
},
|
|
652
|
+
marginLeft: {
|
|
653
|
+
property: "margin",
|
|
654
|
+
hint: "margin: '... left'"
|
|
655
|
+
},
|
|
656
|
+
fontSize: {
|
|
657
|
+
property: "preset",
|
|
658
|
+
hint: "preset: '...'"
|
|
659
|
+
},
|
|
660
|
+
fontWeight: {
|
|
661
|
+
property: "preset",
|
|
662
|
+
hint: "preset: '... strong' (with strong modifier)"
|
|
663
|
+
},
|
|
664
|
+
lineHeight: {
|
|
665
|
+
property: "preset",
|
|
666
|
+
hint: "preset: '... tight' (with tight modifier)"
|
|
667
|
+
},
|
|
668
|
+
boxShadow: {
|
|
669
|
+
property: "shadow",
|
|
670
|
+
hint: "shadow: '...'"
|
|
671
|
+
}
|
|
672
|
+
};
|
|
673
|
+
/**
|
|
674
|
+
* Known preset modifiers.
|
|
675
|
+
*/
|
|
676
|
+
const PRESET_MODIFIERS = new Set([
|
|
677
|
+
"strong",
|
|
678
|
+
"italic",
|
|
679
|
+
"tight"
|
|
680
|
+
]);
|
|
681
|
+
/**
|
|
682
|
+
* Default import sources for tasty.
|
|
683
|
+
*/
|
|
684
|
+
const DEFAULT_IMPORT_SOURCES = ["@tenphi/tasty", "@tenphi/tasty/static"];
|
|
685
|
+
/**
|
|
686
|
+
* Built-in state prefixes that are always valid (not aliases).
|
|
687
|
+
*/
|
|
688
|
+
const BUILT_IN_STATE_PREFIXES = new Set([
|
|
689
|
+
"@media",
|
|
690
|
+
"@root",
|
|
691
|
+
"@own",
|
|
692
|
+
"@supports",
|
|
693
|
+
"@starting",
|
|
694
|
+
"@keyframes",
|
|
695
|
+
"@properties"
|
|
696
|
+
]);
|
|
697
|
+
|
|
698
|
+
//#endregion
|
|
699
|
+
export { BOOLEAN_TRUE_PROPERTIES, BUILT_IN_STATE_PREFIXES, BUILT_IN_UNITS, CSS_UNITS, DEFAULT_IMPORT_SOURCES, DIRECTIONAL_MODIFIERS, KNOWN_CSS_PROPERTIES, KNOWN_TASTY_PROPERTIES, PRESET_MODIFIERS, RADIUS_SHAPES, SEMANTIC_TRANSITIONS, SHORTHAND_MAPPING, SPECIAL_STYLE_KEYS };
|
|
700
|
+
//# sourceMappingURL=constants.mjs.map
|