@styleframe/transpiler 1.0.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/.tsbuildinfo +1 -0
- package/CHANGELOG.md +12 -0
- package/package.json +43 -0
- package/src/constants.ts +4 -0
- package/src/consume/at-rule.test.ts +339 -0
- package/src/consume/at-rule.ts +34 -0
- package/src/consume/consume.test.ts +259 -0
- package/src/consume/consume.ts +60 -0
- package/src/consume/container.test.ts +501 -0
- package/src/consume/container.ts +73 -0
- package/src/consume/css.test.ts +184 -0
- package/src/consume/css.ts +17 -0
- package/src/consume/declarations.test.ts +210 -0
- package/src/consume/declarations.ts +17 -0
- package/src/consume/index.ts +12 -0
- package/src/consume/primitive.test.ts +52 -0
- package/src/consume/primitive.ts +16 -0
- package/src/consume/ref.test.ts +84 -0
- package/src/consume/ref.ts +22 -0
- package/src/consume/root.test.ts +353 -0
- package/src/consume/root.ts +19 -0
- package/src/consume/selector.test.ts +441 -0
- package/src/consume/selector.ts +17 -0
- package/src/consume/theme.test.ts +215 -0
- package/src/consume/theme.ts +15 -0
- package/src/consume/utility.test.ts +696 -0
- package/src/consume/utility.ts +31 -0
- package/src/consume/variable.test.ts +197 -0
- package/src/consume/variable.ts +20 -0
- package/src/defaults.ts +21 -0
- package/src/generator/genAtRuleQuery.test.ts +148 -0
- package/src/generator/genAtRuleQuery.ts +3 -0
- package/src/generator/genDeclaration.test.ts +283 -0
- package/src/generator/genDeclaration.ts +9 -0
- package/src/generator/genDeclarationsBlock.test.ts +278 -0
- package/src/generator/genDeclarationsBlock.ts +7 -0
- package/src/generator/genDeclareVariable.test.ts +323 -0
- package/src/generator/genDeclareVariable.ts +6 -0
- package/src/generator/genInlineAtRule.test.ts +351 -0
- package/src/generator/genInlineAtRule.ts +5 -0
- package/src/generator/genReferenceVariable.test.ts +392 -0
- package/src/generator/genReferenceVariable.ts +5 -0
- package/src/generator/genSafePropertyName.test.ts +489 -0
- package/src/generator/genSafePropertyName.ts +5 -0
- package/src/generator/genSafeVariableName.test.ts +358 -0
- package/src/generator/genSafeVariableName.ts +21 -0
- package/src/generator/genSelector.test.ts +357 -0
- package/src/generator/genSelector.ts +5 -0
- package/src/generator/index.ts +9 -0
- package/src/index.ts +6 -0
- package/src/transpile.test.ts +825 -0
- package/src/transpile.ts +21 -0
- package/src/types.ts +15 -0
- package/src/utils.ts +18 -0
- package/src/vite-env.d.ts +1 -0
- package/tsconfig.json +7 -0
- package/vite.config.ts +5 -0
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { genReferenceVariable } from "./genReferenceVariable";
|
|
3
|
+
|
|
4
|
+
describe("genReferenceVariable", () => {
|
|
5
|
+
it("should generate a basic variable reference", () => {
|
|
6
|
+
const result = genReferenceVariable("primary-color");
|
|
7
|
+
expect(result).toBe("var(--primary-color)");
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it("should preserve existing -- prefix", () => {
|
|
11
|
+
const result = genReferenceVariable("--secondary-color");
|
|
12
|
+
expect(result).toBe("var(--secondary-color)");
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it("should generate a variable reference with fallback", () => {
|
|
16
|
+
const result = genReferenceVariable("primary-color", "#007bff");
|
|
17
|
+
expect(result).toBe("var(--primary-color, #007bff)");
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it("should handle variable reference with color name fallback", () => {
|
|
21
|
+
const result = genReferenceVariable("text-color", "black");
|
|
22
|
+
expect(result).toBe("var(--text-color, black)");
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("should handle variable reference with hex color fallback", () => {
|
|
26
|
+
const result = genReferenceVariable("background", "#ffffff");
|
|
27
|
+
expect(result).toBe("var(--background, #ffffff)");
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it("should handle variable reference with rgb fallback", () => {
|
|
31
|
+
const result = genReferenceVariable("accent", "rgb(255, 0, 0)");
|
|
32
|
+
expect(result).toBe("var(--accent, rgb(255, 0, 0))");
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it("should handle variable reference with rgba fallback", () => {
|
|
36
|
+
const result = genReferenceVariable("overlay", "rgba(0, 0, 0, 0.5)");
|
|
37
|
+
expect(result).toBe("var(--overlay, rgba(0, 0, 0, 0.5))");
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it("should handle variable reference with hsl fallback", () => {
|
|
41
|
+
const result = genReferenceVariable("theme-color", "hsl(210, 100%, 50%)");
|
|
42
|
+
expect(result).toBe("var(--theme-color, hsl(210, 100%, 50%))");
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it("should handle variable reference with numeric fallback", () => {
|
|
46
|
+
const result = genReferenceVariable("spacing", "16px");
|
|
47
|
+
expect(result).toBe("var(--spacing, 16px)");
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it("should handle variable reference with percentage fallback", () => {
|
|
51
|
+
const result = genReferenceVariable("width", "100%");
|
|
52
|
+
expect(result).toBe("var(--width, 100%)");
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it("should handle variable reference with em fallback", () => {
|
|
56
|
+
const result = genReferenceVariable("font-size", "1.5em");
|
|
57
|
+
expect(result).toBe("var(--font-size, 1.5em)");
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it("should handle variable reference with rem fallback", () => {
|
|
61
|
+
const result = genReferenceVariable("margin", "2rem");
|
|
62
|
+
expect(result).toBe("var(--margin, 2rem)");
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it("should handle variable reference with viewport unit fallback", () => {
|
|
66
|
+
const result = genReferenceVariable("height", "100vh");
|
|
67
|
+
expect(result).toBe("var(--height, 100vh)");
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it("should handle variable reference with calc() fallback", () => {
|
|
71
|
+
const result = genReferenceVariable("computed-width", "calc(100% - 20px)");
|
|
72
|
+
expect(result).toBe("var(--computed-width, calc(100% - 20px))");
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it("should handle nested var() as fallback", () => {
|
|
76
|
+
const result = genReferenceVariable("primary", "var(--fallback-color)");
|
|
77
|
+
expect(result).toBe("var(--primary, var(--fallback-color))");
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it("should handle nested var() with its own fallback", () => {
|
|
81
|
+
const result = genReferenceVariable("primary", "var(--secondary, blue)");
|
|
82
|
+
expect(result).toBe("var(--primary, var(--secondary, blue))");
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it("should handle gradient as fallback", () => {
|
|
86
|
+
const result = genReferenceVariable(
|
|
87
|
+
"gradient",
|
|
88
|
+
"linear-gradient(to right, red, blue)",
|
|
89
|
+
);
|
|
90
|
+
expect(result).toBe(
|
|
91
|
+
"var(--gradient, linear-gradient(to right, red, blue))",
|
|
92
|
+
);
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
it("should handle shadow as fallback", () => {
|
|
96
|
+
const result = genReferenceVariable(
|
|
97
|
+
"shadow",
|
|
98
|
+
"0 4px 6px rgba(0, 0, 0, 0.1)",
|
|
99
|
+
);
|
|
100
|
+
expect(result).toBe("var(--shadow, 0 4px 6px rgba(0, 0, 0, 0.1))");
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it("should handle font-family as fallback", () => {
|
|
104
|
+
const result = genReferenceVariable(
|
|
105
|
+
"font-stack",
|
|
106
|
+
"'Helvetica Neue', Arial, sans-serif",
|
|
107
|
+
);
|
|
108
|
+
expect(result).toBe(
|
|
109
|
+
"var(--font-stack, 'Helvetica Neue', Arial, sans-serif)",
|
|
110
|
+
);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
it("should handle transition timing as fallback", () => {
|
|
114
|
+
const result = genReferenceVariable("transition", "all 0.3s ease-in-out");
|
|
115
|
+
expect(result).toBe("var(--transition, all 0.3s ease-in-out)");
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
it("should handle transform as fallback", () => {
|
|
119
|
+
const result = genReferenceVariable(
|
|
120
|
+
"transform",
|
|
121
|
+
"rotate(45deg) scale(1.5)",
|
|
122
|
+
);
|
|
123
|
+
expect(result).toBe("var(--transform, rotate(45deg) scale(1.5))");
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
it("should handle url() as fallback", () => {
|
|
127
|
+
const result = genReferenceVariable(
|
|
128
|
+
"background-image",
|
|
129
|
+
"url('default.jpg')",
|
|
130
|
+
);
|
|
131
|
+
expect(result).toBe("var(--background-image, url('default.jpg'))");
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
it("should handle multiple values as fallback", () => {
|
|
135
|
+
const result = genReferenceVariable("margin", "10px 20px 30px 40px");
|
|
136
|
+
expect(result).toBe("var(--margin, 10px 20px 30px 40px)");
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
it("should handle empty string as fallback", () => {
|
|
140
|
+
const result = genReferenceVariable("content", "");
|
|
141
|
+
expect(result).toBe("var(--content)");
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
it("should handle quoted string as fallback", () => {
|
|
145
|
+
const result = genReferenceVariable("content", '"Hello World"');
|
|
146
|
+
expect(result).toBe('var(--content, "Hello World")');
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
it("should handle single quoted string as fallback", () => {
|
|
150
|
+
const result = genReferenceVariable("label", "'Click here'");
|
|
151
|
+
expect(result).toBe("var(--label, 'Click here')");
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
it("should handle numeric value without units as fallback", () => {
|
|
155
|
+
const result = genReferenceVariable("line-height", "1.5");
|
|
156
|
+
expect(result).toBe("var(--line-height, 1.5)");
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
it("should handle zero as fallback", () => {
|
|
160
|
+
const result = genReferenceVariable("reset", "0");
|
|
161
|
+
expect(result).toBe("var(--reset, 0)");
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
it("should handle negative value as fallback", () => {
|
|
165
|
+
const result = genReferenceVariable("offset", "-10px");
|
|
166
|
+
expect(result).toBe("var(--offset, -10px)");
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
it("should handle decimal value as fallback", () => {
|
|
170
|
+
const result = genReferenceVariable("opacity", "0.75");
|
|
171
|
+
expect(result).toBe("var(--opacity, 0.75)");
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
it("should handle CSS keywords as fallback", () => {
|
|
175
|
+
const result = genReferenceVariable("display", "none");
|
|
176
|
+
expect(result).toBe("var(--display, none)");
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
it("should handle inherit keyword as fallback", () => {
|
|
180
|
+
const result = genReferenceVariable("color", "inherit");
|
|
181
|
+
expect(result).toBe("var(--color, inherit)");
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
it("should handle initial keyword as fallback", () => {
|
|
185
|
+
const result = genReferenceVariable("value", "initial");
|
|
186
|
+
expect(result).toBe("var(--value, initial)");
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
it("should handle unset keyword as fallback", () => {
|
|
190
|
+
const result = genReferenceVariable("property", "unset");
|
|
191
|
+
expect(result).toBe("var(--property, unset)");
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
it("should handle currentColor keyword as fallback", () => {
|
|
195
|
+
const result = genReferenceVariable("border-color", "currentColor");
|
|
196
|
+
expect(result).toBe("var(--border-color, currentColor)");
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
it("should handle transparent keyword as fallback", () => {
|
|
200
|
+
const result = genReferenceVariable("bg", "transparent");
|
|
201
|
+
expect(result).toBe("var(--bg, transparent)");
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
it("should handle variable names with numbers", () => {
|
|
205
|
+
const result = genReferenceVariable("spacing-2");
|
|
206
|
+
expect(result).toBe("var(--spacing-2)");
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
it("should handle variable names with underscores", () => {
|
|
210
|
+
const result = genReferenceVariable("primary_color");
|
|
211
|
+
expect(result).toBe("var(--primary_color)");
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
it("should handle camelCase variable names", () => {
|
|
215
|
+
const result = genReferenceVariable("primaryColor");
|
|
216
|
+
expect(result).toBe("var(--primaryColor)");
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
it("should handle variable names starting with numbers", () => {
|
|
220
|
+
const result = genReferenceVariable("1-column");
|
|
221
|
+
expect(result).toBe("var(--1-column)");
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
it("should handle complex calc with nested operations as fallback", () => {
|
|
225
|
+
const result = genReferenceVariable("complex", "calc((100% - 20px) / 2)");
|
|
226
|
+
expect(result).toBe("var(--complex, calc((100% - 20px) / 2))");
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
it("should handle min() function as fallback", () => {
|
|
230
|
+
const result = genReferenceVariable("width", "min(100%, 500px)");
|
|
231
|
+
expect(result).toBe("var(--width, min(100%, 500px))");
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
it("should handle max() function as fallback", () => {
|
|
235
|
+
const result = genReferenceVariable("height", "max(50vh, 300px)");
|
|
236
|
+
expect(result).toBe("var(--height, max(50vh, 300px))");
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
it("should handle clamp() function as fallback", () => {
|
|
240
|
+
const result = genReferenceVariable("font-size", "clamp(1rem, 2vw, 3rem)");
|
|
241
|
+
expect(result).toBe("var(--font-size, clamp(1rem, 2vw, 3rem))");
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
it("should handle cubic-bezier as fallback", () => {
|
|
245
|
+
const result = genReferenceVariable(
|
|
246
|
+
"easing",
|
|
247
|
+
"cubic-bezier(0.4, 0, 0.2, 1)",
|
|
248
|
+
);
|
|
249
|
+
expect(result).toBe("var(--easing, cubic-bezier(0.4, 0, 0.2, 1))");
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
it("should handle filter functions as fallback", () => {
|
|
253
|
+
const result = genReferenceVariable("blur", "blur(5px)");
|
|
254
|
+
expect(result).toBe("var(--blur, blur(5px))");
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
it("should handle multiple shadows as fallback", () => {
|
|
258
|
+
const result = genReferenceVariable(
|
|
259
|
+
"shadows",
|
|
260
|
+
"0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24)",
|
|
261
|
+
);
|
|
262
|
+
expect(result).toBe(
|
|
263
|
+
"var(--shadows, 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24))",
|
|
264
|
+
);
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
it("should handle grid template as fallback", () => {
|
|
268
|
+
const result = genReferenceVariable("grid-columns", "repeat(3, 1fr)");
|
|
269
|
+
expect(result).toBe("var(--grid-columns, repeat(3, 1fr))");
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
it("should handle CSS Grid line names as fallback", () => {
|
|
273
|
+
const result = genReferenceVariable(
|
|
274
|
+
"grid-rows",
|
|
275
|
+
"[header-start] 100px [header-end content-start] 1fr [content-end]",
|
|
276
|
+
);
|
|
277
|
+
expect(result).toBe(
|
|
278
|
+
"var(--grid-rows, [header-start] 100px [header-end content-start] 1fr [content-end])",
|
|
279
|
+
);
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
it("should handle env() function as fallback", () => {
|
|
283
|
+
const result = genReferenceVariable("safe-top", "env(safe-area-inset-top)");
|
|
284
|
+
expect(result).toBe("var(--safe-top, env(safe-area-inset-top))");
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
it("should handle attr() function as fallback", () => {
|
|
288
|
+
const result = genReferenceVariable("content", "attr(data-label)");
|
|
289
|
+
expect(result).toBe("var(--content, attr(data-label))");
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
it("should handle counter() function as fallback", () => {
|
|
293
|
+
const result = genReferenceVariable("counter", "counter(section)");
|
|
294
|
+
expect(result).toBe("var(--counter, counter(section))");
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
it("should handle whitespace in fallback values", () => {
|
|
298
|
+
const result = genReferenceVariable("padding", " 10px 20px ");
|
|
299
|
+
expect(result).toBe("var(--padding, 10px 20px )");
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
it("should handle special CSS color names as fallback", () => {
|
|
303
|
+
const result = genReferenceVariable("color", "rebeccapurple");
|
|
304
|
+
expect(result).toBe("var(--color, rebeccapurple)");
|
|
305
|
+
});
|
|
306
|
+
|
|
307
|
+
it("should handle system colors as fallback", () => {
|
|
308
|
+
const result = genReferenceVariable("color", "ButtonText");
|
|
309
|
+
expect(result).toBe("var(--color, ButtonText)");
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
it("should handle variable name with single dash", () => {
|
|
313
|
+
const result = genReferenceVariable("-custom");
|
|
314
|
+
expect(result).toBe("var(---custom)");
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
it("should handle variable name with triple dash", () => {
|
|
318
|
+
const result = genReferenceVariable("---extra");
|
|
319
|
+
expect(result).toBe("var(---extra)");
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
it("should handle emoji in fallback", () => {
|
|
323
|
+
const result = genReferenceVariable("emoji", "'🎉'");
|
|
324
|
+
expect(result).toBe("var(--emoji, '🎉')");
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
it("should handle unicode escape sequences in fallback", () => {
|
|
328
|
+
const result = genReferenceVariable("unicode", "'\\2022'");
|
|
329
|
+
expect(result).toBe("var(--unicode, '\\2022')");
|
|
330
|
+
});
|
|
331
|
+
|
|
332
|
+
it("should handle data URI as fallback", () => {
|
|
333
|
+
const result = genReferenceVariable(
|
|
334
|
+
"icon",
|
|
335
|
+
"url('data:image/svg+xml;base64,PHN2ZyB4...')",
|
|
336
|
+
);
|
|
337
|
+
expect(result).toBe(
|
|
338
|
+
"var(--icon, url('data:image/svg+xml;base64,PHN2ZyB4...'))",
|
|
339
|
+
);
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
it("should handle undefined fallback", () => {
|
|
343
|
+
const result = genReferenceVariable("variable", undefined);
|
|
344
|
+
expect(result).toBe("var(--variable)");
|
|
345
|
+
});
|
|
346
|
+
|
|
347
|
+
it("should handle invalid empty variable name with prefix", () => {
|
|
348
|
+
const result = genReferenceVariable("--");
|
|
349
|
+
expect(result).toBe("var(--unknown-variable)");
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
it("should handle variable reference without fallback", () => {
|
|
353
|
+
const result = genReferenceVariable("theme-primary");
|
|
354
|
+
expect(result).toBe("var(--theme-primary)");
|
|
355
|
+
});
|
|
356
|
+
|
|
357
|
+
it("should handle !important in fallback (though unusual)", () => {
|
|
358
|
+
const result = genReferenceVariable("color", "red !important");
|
|
359
|
+
expect(result).toBe("var(--color, red !important)");
|
|
360
|
+
});
|
|
361
|
+
|
|
362
|
+
it("should handle comma-separated fallback values", () => {
|
|
363
|
+
const result = genReferenceVariable(
|
|
364
|
+
"fonts",
|
|
365
|
+
"Arial, Helvetica, sans-serif",
|
|
366
|
+
);
|
|
367
|
+
expect(result).toBe("var(--fonts, Arial, Helvetica, sans-serif)");
|
|
368
|
+
});
|
|
369
|
+
|
|
370
|
+
it("should handle steps timing function as fallback", () => {
|
|
371
|
+
const result = genReferenceVariable("animation-timing", "steps(4, end)");
|
|
372
|
+
expect(result).toBe("var(--animation-timing, steps(4, end))");
|
|
373
|
+
});
|
|
374
|
+
|
|
375
|
+
it("should handle complex nested calc as fallback", () => {
|
|
376
|
+
const result = genReferenceVariable(
|
|
377
|
+
"width",
|
|
378
|
+
"calc(100% - calc(20px + 2em))",
|
|
379
|
+
);
|
|
380
|
+
expect(result).toBe("var(--width, calc(100% - calc(20px + 2em)))");
|
|
381
|
+
});
|
|
382
|
+
|
|
383
|
+
it("should handle auto keyword as fallback", () => {
|
|
384
|
+
const result = genReferenceVariable("margin", "auto");
|
|
385
|
+
expect(result).toBe("var(--margin, auto)");
|
|
386
|
+
});
|
|
387
|
+
|
|
388
|
+
it("should handle revert keyword as fallback", () => {
|
|
389
|
+
const result = genReferenceVariable("font-size", "revert");
|
|
390
|
+
expect(result).toBe("var(--font-size, revert)");
|
|
391
|
+
});
|
|
392
|
+
});
|