react-native-css 3.0.0-nightly.75f8b74 → 3.0.0-nightly.d8cb1bc
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/dist/commonjs/compiler/atRules.js +1 -1
- package/dist/commonjs/compiler/attributes.test.js +1 -1
- package/dist/commonjs/compiler/attributes.test.js.map +1 -1
- package/dist/commonjs/compiler/compiler.js +26 -17
- package/dist/commonjs/compiler/compiler.js.map +1 -1
- package/dist/commonjs/compiler/declarations.js +164 -72
- package/dist/commonjs/compiler/declarations.js.map +1 -1
- package/dist/commonjs/compiler/inheritance.test.js +7 -7
- package/dist/commonjs/compiler/inheritance.test.js.map +1 -1
- package/dist/commonjs/compiler/selector-builder.js +457 -0
- package/dist/commonjs/compiler/selector-builder.js.map +1 -0
- package/dist/commonjs/compiler/selectors.js +10 -6
- package/dist/commonjs/compiler/selectors.js.map +1 -1
- package/dist/commonjs/compiler/stylesheet.js +113 -39
- package/dist/commonjs/compiler/stylesheet.js.map +1 -1
- package/dist/commonjs/jest/index.js +16 -5
- package/dist/commonjs/jest/index.js.map +1 -1
- package/dist/commonjs/metro/index.js +1 -1
- package/dist/commonjs/metro/index.js.map +1 -1
- package/dist/commonjs/poison.pill.js +4 -1
- package/dist/commonjs/poison.pill.js.map +1 -1
- package/dist/commonjs/runtime/native/conditions/attributes.js +42 -0
- package/dist/commonjs/runtime/native/conditions/attributes.js.map +1 -0
- package/dist/commonjs/runtime/native/conditions/container-query.js +28 -21
- package/dist/commonjs/runtime/native/conditions/container-query.js.map +1 -1
- package/dist/commonjs/runtime/native/conditions/guards.js.map +1 -1
- package/dist/commonjs/runtime/native/conditions/index.js +10 -46
- package/dist/commonjs/runtime/native/conditions/index.js.map +1 -1
- package/dist/commonjs/runtime/native/conditions/media-query.js +17 -17
- package/dist/commonjs/runtime/native/conditions/media-query.js.map +1 -1
- package/dist/commonjs/runtime/native/injection.js +3 -2
- package/dist/commonjs/runtime/native/injection.js.map +1 -1
- package/dist/commonjs/runtime/native/react/interaction.js +10 -10
- package/dist/commonjs/runtime/native/react/interaction.js.map +1 -1
- package/dist/commonjs/runtime/native/react/rules.js +9 -9
- package/dist/commonjs/runtime/native/react/rules.js.map +1 -1
- package/dist/commonjs/runtime/native/react/useNativeCss.js +1 -0
- package/dist/commonjs/runtime/native/react/useNativeCss.js.map +1 -1
- package/dist/commonjs/runtime/native/reactivity.js +1 -12
- package/dist/commonjs/runtime/native/reactivity.js.map +1 -1
- package/dist/commonjs/runtime/native/root.js +28 -0
- package/dist/commonjs/runtime/native/root.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/calculate-props.js +53 -48
- package/dist/commonjs/runtime/native/styles/calculate-props.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/index.js +12 -12
- package/dist/commonjs/runtime/native/styles/index.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/units.js +6 -3
- package/dist/commonjs/runtime/native/styles/units.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/variables.js +3 -2
- package/dist/commonjs/runtime/native/styles/variables.js.map +1 -1
- package/dist/commonjs/runtime/utils/specificity.js +2 -1
- package/dist/commonjs/runtime/utils/specificity.js.map +1 -1
- package/dist/module/compiler/atRules.js +1 -1
- package/dist/module/compiler/attributes.test.js +1 -1
- package/dist/module/compiler/attributes.test.js.map +1 -1
- package/dist/module/compiler/compiler.js +26 -17
- package/dist/module/compiler/compiler.js.map +1 -1
- package/dist/module/compiler/compiler.types.js.map +1 -1
- package/dist/module/compiler/declarations.js +159 -68
- package/dist/module/compiler/declarations.js.map +1 -1
- package/dist/module/compiler/inheritance.test.js +7 -7
- package/dist/module/compiler/inheritance.test.js.map +1 -1
- package/dist/module/compiler/selector-builder.js +452 -0
- package/dist/module/compiler/selector-builder.js.map +1 -0
- package/dist/module/compiler/selectors.js +10 -6
- package/dist/module/compiler/selectors.js.map +1 -1
- package/dist/module/compiler/stylesheet.js +112 -38
- package/dist/module/compiler/stylesheet.js.map +1 -1
- package/dist/module/jest/index.js +16 -4
- package/dist/module/jest/index.js.map +1 -1
- package/dist/module/metro/index.js +1 -1
- package/dist/module/metro/index.js.map +1 -1
- package/dist/module/poison.pill.js +4 -1
- package/dist/module/poison.pill.js.map +1 -1
- package/dist/module/runtime/native/conditions/attributes.js +38 -0
- package/dist/module/runtime/native/conditions/attributes.js.map +1 -0
- package/dist/module/runtime/native/conditions/container-query.js +28 -21
- package/dist/module/runtime/native/conditions/container-query.js.map +1 -1
- package/dist/module/runtime/native/conditions/guards.js.map +1 -1
- package/dist/module/runtime/native/conditions/index.js +10 -46
- package/dist/module/runtime/native/conditions/index.js.map +1 -1
- package/dist/module/runtime/native/conditions/media-query.js +17 -17
- package/dist/module/runtime/native/conditions/media-query.js.map +1 -1
- package/dist/module/runtime/native/injection.js +2 -1
- package/dist/module/runtime/native/injection.js.map +1 -1
- package/dist/module/runtime/native/react/interaction.js +10 -10
- package/dist/module/runtime/native/react/interaction.js.map +1 -1
- package/dist/module/runtime/native/react/rules.js +9 -9
- package/dist/module/runtime/native/react/rules.js.map +1 -1
- package/dist/module/runtime/native/react/useNativeCss.js +1 -0
- package/dist/module/runtime/native/react/useNativeCss.js.map +1 -1
- package/dist/module/runtime/native/reactivity.js +0 -11
- package/dist/module/runtime/native/reactivity.js.map +1 -1
- package/dist/module/runtime/native/root.js +24 -0
- package/dist/module/runtime/native/root.js.map +1 -0
- package/dist/module/runtime/native/styles/calculate-props.js +53 -48
- package/dist/module/runtime/native/styles/calculate-props.js.map +1 -1
- package/dist/module/runtime/native/styles/index.js +12 -12
- package/dist/module/runtime/native/styles/index.js.map +1 -1
- package/dist/module/runtime/native/styles/units.js +6 -3
- package/dist/module/runtime/native/styles/units.js.map +1 -1
- package/dist/module/runtime/native/styles/variables.js +2 -1
- package/dist/module/runtime/native/styles/variables.js.map +1 -1
- package/dist/module/runtime/utils/specificity.js +2 -1
- package/dist/module/runtime/utils/specificity.js.map +1 -1
- package/dist/typescript/commonjs/src/compiler/compiler.d.ts +9 -2
- package/dist/typescript/commonjs/src/compiler/compiler.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts +5 -4
- package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts +16 -19
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts +23 -0
- package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/compiler/selectors.d.ts +3 -2
- package/dist/typescript/commonjs/src/compiler/selectors.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts +21 -7
- package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/jest/index.d.ts +8 -1
- package/dist/typescript/commonjs/src/jest/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/poison.pill.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/conditions/attributes.d.ts +5 -0
- package/dist/typescript/commonjs/src/runtime/native/conditions/attributes.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/conditions/container-query.d.ts +3 -3
- package/dist/typescript/commonjs/src/runtime/native/conditions/container-query.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/conditions/guards.d.ts +2 -2
- package/dist/typescript/commonjs/src/runtime/native/conditions/guards.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/conditions/index.d.ts +2 -2
- package/dist/typescript/commonjs/src/runtime/native/conditions/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/conditions/media-query.d.ts +2 -2
- package/dist/typescript/commonjs/src/runtime/native/conditions/media-query.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/injection.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/react/interaction.d.ts +2 -2
- package/dist/typescript/commonjs/src/runtime/native/react/interaction.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/react/useNativeCss.d.ts +2 -1
- package/dist/typescript/commonjs/src/runtime/native/react/useNativeCss.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/reactivity.d.ts +2 -10
- package/dist/typescript/commonjs/src/runtime/native/reactivity.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/root.d.ts +11 -0
- package/dist/typescript/commonjs/src/runtime/native/root.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/calculate-props.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/units.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/variables.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/utils/specificity.d.ts +1 -0
- package/dist/typescript/commonjs/src/runtime/utils/specificity.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/compiler.d.ts +9 -2
- package/dist/typescript/module/src/compiler/compiler.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/compiler.types.d.ts +5 -4
- package/dist/typescript/module/src/compiler/compiler.types.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/declarations.d.ts +16 -19
- package/dist/typescript/module/src/compiler/declarations.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/selector-builder.d.ts +23 -0
- package/dist/typescript/module/src/compiler/selector-builder.d.ts.map +1 -0
- package/dist/typescript/module/src/compiler/selectors.d.ts +3 -2
- package/dist/typescript/module/src/compiler/selectors.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/stylesheet.d.ts +21 -7
- package/dist/typescript/module/src/compiler/stylesheet.d.ts.map +1 -1
- package/dist/typescript/module/src/jest/index.d.ts +8 -1
- package/dist/typescript/module/src/jest/index.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/index.d.ts.map +1 -1
- package/dist/typescript/module/src/poison.pill.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/conditions/attributes.d.ts +5 -0
- package/dist/typescript/module/src/runtime/native/conditions/attributes.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/conditions/container-query.d.ts +3 -3
- package/dist/typescript/module/src/runtime/native/conditions/container-query.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/conditions/guards.d.ts +2 -2
- package/dist/typescript/module/src/runtime/native/conditions/guards.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/conditions/index.d.ts +2 -2
- package/dist/typescript/module/src/runtime/native/conditions/index.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/conditions/media-query.d.ts +2 -2
- package/dist/typescript/module/src/runtime/native/conditions/media-query.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/injection.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/react/interaction.d.ts +2 -2
- package/dist/typescript/module/src/runtime/native/react/interaction.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/react/useNativeCss.d.ts +2 -1
- package/dist/typescript/module/src/runtime/native/react/useNativeCss.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/reactivity.d.ts +2 -10
- package/dist/typescript/module/src/runtime/native/reactivity.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/root.d.ts +11 -0
- package/dist/typescript/module/src/runtime/native/root.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/calculate-props.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/units.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/variables.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/utils/specificity.d.ts +1 -0
- package/dist/typescript/module/src/runtime/utils/specificity.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/compiler/atRules.ts +1 -1
- package/src/compiler/attributes.test.ts +1 -1
- package/src/compiler/compiler.ts +30 -31
- package/src/compiler/compiler.types.ts +7 -5
- package/src/compiler/declarations.ts +273 -67
- package/src/compiler/inheritance.test.ts +6 -6
- package/src/compiler/selector-builder.ts +531 -0
- package/src/compiler/selectors.ts +20 -6
- package/src/compiler/stylesheet.ts +154 -45
- package/src/jest/index.ts +19 -4
- package/src/metro/index.ts +6 -3
- package/src/poison.pill.ts +5 -1
- package/src/runtime/native/conditions/attributes.ts +52 -0
- package/src/runtime/native/conditions/container-query.ts +27 -22
- package/src/runtime/native/conditions/guards.ts +1 -2
- package/src/runtime/native/conditions/index.ts +12 -66
- package/src/runtime/native/conditions/media-query.ts +18 -20
- package/src/runtime/native/injection.ts +1 -1
- package/src/runtime/native/react/interaction.ts +12 -12
- package/src/runtime/native/react/rules.ts +9 -9
- package/src/runtime/native/react/useNativeCss.ts +3 -0
- package/src/runtime/native/reactivity.ts +2 -21
- package/src/runtime/native/root.ts +31 -0
- package/src/runtime/native/styles/calculate-props.ts +59 -49
- package/src/runtime/native/styles/index.ts +12 -12
- package/src/runtime/native/styles/units.ts +7 -3
- package/src/runtime/native/styles/variables.ts +2 -6
- package/src/runtime/utils/specificity.ts +1 -0
|
@@ -29,37 +29,44 @@ const parsers = {
|
|
|
29
29
|
"block-size": parseSizeDeclaration,
|
|
30
30
|
"border": parseBorder,
|
|
31
31
|
"border-block": parseBorderBlock,
|
|
32
|
-
"border-block-color":
|
|
32
|
+
"border-block-color": parseBorderColor,
|
|
33
33
|
"border-block-end": parseBorderBlockEnd,
|
|
34
34
|
"border-block-end-color": parseColorDeclaration,
|
|
35
35
|
"border-block-end-width": parseBorderSideWidthDeclaration,
|
|
36
36
|
"border-block-start": parseBorderBlockStart,
|
|
37
37
|
"border-block-start-color": parseColorDeclaration,
|
|
38
38
|
"border-block-start-width": parseBorderSideWidthDeclaration,
|
|
39
|
+
"border-block-style": parseBorderBlockStyle,
|
|
39
40
|
"border-block-width": parseBorderBlockWidth,
|
|
40
41
|
"border-bottom": parseBorderSide,
|
|
41
42
|
"border-bottom-color": parseColorDeclaration,
|
|
42
43
|
"border-bottom-left-radius": parseSize2DDimensionPercentageDeclaration,
|
|
43
44
|
"border-bottom-right-radius": parseSize2DDimensionPercentageDeclaration,
|
|
45
|
+
"border-bottom-style": parseBorderStyleDeclaration,
|
|
44
46
|
"border-bottom-width": parseBorderSideWidthDeclaration,
|
|
45
47
|
"border-color": parseBorderColor,
|
|
46
48
|
"border-end-end-radius": parseSize2DDimensionPercentageDeclaration,
|
|
47
49
|
"border-end-start-radius": parseSize2DDimensionPercentageDeclaration,
|
|
48
50
|
"border-inline": parseBorderInline,
|
|
49
|
-
"border-inline-color":
|
|
51
|
+
"border-inline-color": parseBorderColor,
|
|
50
52
|
"border-inline-end": parseBorderInlineEnd,
|
|
51
53
|
"border-inline-end-color": parseColorDeclaration,
|
|
54
|
+
"border-inline-end-style": parseBorderInlineStyle,
|
|
52
55
|
"border-inline-end-width": parseBorderSideWidthDeclaration,
|
|
53
56
|
"border-inline-start": parseBorderInlineStart,
|
|
54
57
|
"border-inline-start-color": parseColorDeclaration,
|
|
58
|
+
"border-inline-start-style": parseBorderInlineStyle,
|
|
55
59
|
"border-inline-start-width": parseBorderSideWidthDeclaration,
|
|
56
|
-
"border-inline-
|
|
60
|
+
"border-inline-style": parseBorderInlineStyle,
|
|
61
|
+
"border-inline-width": parseBorderInlineWidth,
|
|
57
62
|
"border-left": parseBorderSide,
|
|
58
63
|
"border-left-color": parseColorDeclaration,
|
|
64
|
+
"border-left-style": parseBorderStyleDeclaration,
|
|
59
65
|
"border-left-width": parseBorderSideWidthDeclaration,
|
|
60
66
|
"border-radius": parseBorderRadius,
|
|
61
67
|
"border-right": parseBorderSide,
|
|
62
68
|
"border-right-color": parseColorDeclaration,
|
|
69
|
+
"border-right-style": parseBorderStyleDeclaration,
|
|
63
70
|
"border-right-width": parseBorderSideWidthDeclaration,
|
|
64
71
|
"border-start-end-radius": parseSize2DDimensionPercentageDeclaration,
|
|
65
72
|
"border-start-start-radius": parseSize2DDimensionPercentageDeclaration,
|
|
@@ -68,11 +75,12 @@ const parsers = {
|
|
|
68
75
|
"border-top-color": parseColorDeclaration,
|
|
69
76
|
"border-top-left-radius": parseSize2DDimensionPercentageDeclaration,
|
|
70
77
|
"border-top-right-radius": parseSize2DDimensionPercentageDeclaration,
|
|
78
|
+
"border-top-style": parseBorderStyleDeclaration,
|
|
71
79
|
"border-top-width": parseBorderSideWidthDeclaration,
|
|
72
80
|
"border-width": parseBorderWidth,
|
|
73
81
|
"bottom": parseSizeDeclaration,
|
|
74
82
|
"box-shadow": parseBoxShadow,
|
|
75
|
-
"caret-color":
|
|
83
|
+
"caret-color": parseCaretColor,
|
|
76
84
|
"color": parseFontColorDeclaration,
|
|
77
85
|
"column-gap": parseGap,
|
|
78
86
|
"container": parseContainer,
|
|
@@ -183,6 +191,12 @@ const parsers = {
|
|
|
183
191
|
// This is missing LightningCSS types
|
|
184
192
|
parsers["pointer-events"] = parsePointerEvents;
|
|
185
193
|
const validProperties = new Set(Object.keys(parsers));
|
|
194
|
+
function parseCaretColor(declaration, builder) {
|
|
195
|
+
builder.addMapping({
|
|
196
|
+
[declaration.property]: ["cursorColor"]
|
|
197
|
+
});
|
|
198
|
+
builder.addDescriptor("caret-color", parseColorOrAutoDeclaration(declaration, builder));
|
|
199
|
+
}
|
|
186
200
|
export function parseDeclaration(declaration, builder) {
|
|
187
201
|
if ("vendorPrefix" in declaration && declaration.vendorPrefix.length) {
|
|
188
202
|
return;
|
|
@@ -191,9 +205,9 @@ export function parseDeclaration(declaration, builder) {
|
|
|
191
205
|
return;
|
|
192
206
|
}
|
|
193
207
|
if (declaration.property === "unparsed") {
|
|
194
|
-
|
|
208
|
+
parseUnparsedDeclaration(declaration, builder);
|
|
195
209
|
} else if (declaration.property === "custom") {
|
|
196
|
-
|
|
210
|
+
parseCustomDeclaration(declaration, builder);
|
|
197
211
|
} else {
|
|
198
212
|
parseWithParser(declaration, builder);
|
|
199
213
|
}
|
|
@@ -202,6 +216,7 @@ function parseWithParser(declaration, builder) {
|
|
|
202
216
|
if (declaration.property in parsers) {
|
|
203
217
|
const parser = parsers[declaration.property];
|
|
204
218
|
builder.descriptorProperty = declaration.property;
|
|
219
|
+
builder.setWarningProperty(declaration.property);
|
|
205
220
|
const value = parser(declaration, builder, declaration.property);
|
|
206
221
|
if (value !== undefined) {
|
|
207
222
|
builder.addDescriptor(propertyRename[declaration.property] ?? declaration.property, value);
|
|
@@ -246,15 +261,25 @@ function parseBorderRadius({
|
|
|
246
261
|
"border-top-right-radius": parseSize2DDimensionPercentage(value.topRight, builder)
|
|
247
262
|
});
|
|
248
263
|
}
|
|
249
|
-
function parseBorderColor({
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
264
|
+
function parseBorderColor(declaration, builder) {
|
|
265
|
+
switch (declaration.property) {
|
|
266
|
+
case "border-color":
|
|
267
|
+
builder.addShorthand("border-color", {
|
|
268
|
+
"border-top-color": parseColor(declaration.value.top, builder),
|
|
269
|
+
"border-bottom-color": parseColor(declaration.value.bottom, builder),
|
|
270
|
+
"border-left-color": parseColor(declaration.value.left, builder),
|
|
271
|
+
"border-right-color": parseColor(declaration.value.right, builder)
|
|
272
|
+
});
|
|
273
|
+
break;
|
|
274
|
+
case "border-block-color":
|
|
275
|
+
builder.addDescriptor("border-top-color", parseColor(declaration.value.start, builder));
|
|
276
|
+
builder.addDescriptor("border-bottom-color", parseColor(declaration.value.end, builder));
|
|
277
|
+
break;
|
|
278
|
+
case "border-inline-color":
|
|
279
|
+
builder.addDescriptor("border-left-color", parseColor(declaration.value.start, builder));
|
|
280
|
+
builder.addDescriptor("border-right-color", parseColor(declaration.value.end, builder));
|
|
281
|
+
break;
|
|
282
|
+
}
|
|
258
283
|
}
|
|
259
284
|
function parseBorderWidth({
|
|
260
285
|
value
|
|
@@ -322,6 +347,19 @@ function parseBorderInlineEnd({
|
|
|
322
347
|
builder.addDescriptor("border-right-color", parseColor(value.color, builder));
|
|
323
348
|
builder.addDescriptor("border-right-width", parseBorderSideWidth(value.width, builder));
|
|
324
349
|
}
|
|
350
|
+
export function parseBorderInlineWidth(declaration, builder) {
|
|
351
|
+
builder.addDescriptor("border-left-width", parseBorderSideWidth(declaration.value.start, builder));
|
|
352
|
+
builder.addDescriptor("border-right-width", parseBorderSideWidth(declaration.value.end, builder));
|
|
353
|
+
}
|
|
354
|
+
export function parseBorderInlineStyle(declaration, builder) {
|
|
355
|
+
if (typeof declaration.value === "string") {
|
|
356
|
+
builder.addDescriptor("border-style", parseBorderStyle(declaration.value, builder));
|
|
357
|
+
} else if (declaration.value.start === declaration.value.end) {
|
|
358
|
+
builder.addDescriptor("border-style", parseBorderStyle(declaration.value.start, builder));
|
|
359
|
+
} else {
|
|
360
|
+
builder.addWarning("property", "border-inline-style");
|
|
361
|
+
}
|
|
362
|
+
}
|
|
325
363
|
function parseFlexFlow({
|
|
326
364
|
value
|
|
327
365
|
}, builder) {
|
|
@@ -481,7 +519,11 @@ function parseLetterSpacing({
|
|
|
481
519
|
if (value.type === "normal") {
|
|
482
520
|
return;
|
|
483
521
|
}
|
|
484
|
-
|
|
522
|
+
const descriptor = parseLength(value.value, builder);
|
|
523
|
+
if (Array.isArray(descriptor) && descriptor[1] === "em" && typeof descriptor[2] === "number") {
|
|
524
|
+
return descriptor[2];
|
|
525
|
+
}
|
|
526
|
+
return descriptor;
|
|
485
527
|
}
|
|
486
528
|
function parseTextDecoration({
|
|
487
529
|
value
|
|
@@ -499,7 +541,8 @@ function parseZIndex({
|
|
|
499
541
|
return;
|
|
500
542
|
}
|
|
501
543
|
}
|
|
502
|
-
function parseContainerType(
|
|
544
|
+
function parseContainerType(_declaration, builder) {
|
|
545
|
+
builder.addContainer(["___default___"]);
|
|
503
546
|
return;
|
|
504
547
|
}
|
|
505
548
|
function parseContainerName({
|
|
@@ -514,12 +557,13 @@ function parseContainer({
|
|
|
514
557
|
builder.addContainer(value.name.type === "none" ? false : value.name.value);
|
|
515
558
|
return;
|
|
516
559
|
}
|
|
517
|
-
export function
|
|
560
|
+
export function parseUnparsedDeclaration(declaration, builder) {
|
|
518
561
|
let property = declaration.value.propertyId.property;
|
|
519
562
|
if (!(property in parsers)) {
|
|
520
563
|
builder.addWarning("property", property);
|
|
521
564
|
return;
|
|
522
565
|
}
|
|
566
|
+
builder.setWarningProperty(property);
|
|
523
567
|
|
|
524
568
|
/**
|
|
525
569
|
* React Native doesn't support all the logical properties
|
|
@@ -534,14 +578,14 @@ export function parseDeclarationUnparsed(declaration, builder) {
|
|
|
534
578
|
*/
|
|
535
579
|
builder.descriptorProperty = property;
|
|
536
580
|
if (unparsedRuntimeParsing.has(property)) {
|
|
537
|
-
const args = parseUnparsed(declaration.value.value, builder);
|
|
581
|
+
const args = parseUnparsed(declaration.value.value, builder, property);
|
|
538
582
|
if (property === "animation") {
|
|
539
583
|
builder.addDescriptor("animation", [{}, `@${toRNProperty(property)}`, args]);
|
|
540
584
|
} else {
|
|
541
585
|
builder.addDescriptor(property, [{}, `@${toRNProperty(property)}`, args, 1]);
|
|
542
586
|
}
|
|
543
587
|
} else {
|
|
544
|
-
const value = parseUnparsed(declaration.value.value, builder);
|
|
588
|
+
const value = parseUnparsed(declaration.value.value, builder, property);
|
|
545
589
|
builder.addDescriptor(property, value);
|
|
546
590
|
if (property === "font-size") {
|
|
547
591
|
builder.addDescriptor("--__rn-css-em", value);
|
|
@@ -551,16 +595,21 @@ export function parseDeclarationUnparsed(declaration, builder) {
|
|
|
551
595
|
}
|
|
552
596
|
}
|
|
553
597
|
}
|
|
554
|
-
export function
|
|
598
|
+
export function parseCustomDeclaration(declaration, builder) {
|
|
555
599
|
const property = declaration.value.name;
|
|
556
600
|
if (validProperties.has(property) || property.startsWith("--") || property.startsWith("-rn-")) {
|
|
557
|
-
builder.addDescriptor(property, parseUnparsed(declaration.value.value, builder,
|
|
601
|
+
builder.addDescriptor(property, parseUnparsed(declaration.value.value, builder, property));
|
|
602
|
+
} else if (property === "-webkit-line-clamp") {
|
|
603
|
+
builder.addMapping({
|
|
604
|
+
[property]: ["numberOfLines"]
|
|
605
|
+
});
|
|
606
|
+
builder.addDescriptor(property, parseUnparsed(declaration.value.value, builder, property));
|
|
558
607
|
} else {
|
|
559
608
|
builder.addWarning("property", declaration.value.name);
|
|
560
609
|
}
|
|
561
610
|
}
|
|
562
|
-
export function reduceParseUnparsed(tokenOrValues, builder) {
|
|
563
|
-
const result = tokenOrValues.map(tokenOrValue => parseUnparsed(tokenOrValue, builder)).filter(v => v !== undefined);
|
|
611
|
+
export function reduceParseUnparsed(tokenOrValues, builder, property, allowAuto) {
|
|
612
|
+
const result = tokenOrValues.map(tokenOrValue => parseUnparsed(tokenOrValue, builder, property, allowAuto)).filter(v => v !== undefined);
|
|
564
613
|
if (result.length === 0) {
|
|
565
614
|
return undefined;
|
|
566
615
|
}
|
|
@@ -574,6 +623,9 @@ export function reduceParseUnparsed(tokenOrValues, builder) {
|
|
|
574
623
|
currentGroup.push(value);
|
|
575
624
|
}
|
|
576
625
|
}
|
|
626
|
+
|
|
627
|
+
// Groups are the tokens grouped together by comma location
|
|
628
|
+
// If a group only has 1 item, it shouldn't be an array
|
|
577
629
|
groups = groups.flatMap(group => {
|
|
578
630
|
if (!Array.isArray(group)) {
|
|
579
631
|
return [];
|
|
@@ -587,21 +639,26 @@ export function reduceParseUnparsed(tokenOrValues, builder) {
|
|
|
587
639
|
} else {
|
|
588
640
|
return [first];
|
|
589
641
|
}
|
|
642
|
+
} else if (
|
|
643
|
+
// This is a special case for <ratio> values
|
|
644
|
+
group.includes("/") && group.every(item => typeof item === "string" && item === "/" ? item : typeof item === "number")) {
|
|
645
|
+
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
646
|
+
return [group.join(" ")];
|
|
590
647
|
} else {
|
|
591
648
|
return [group];
|
|
592
649
|
}
|
|
593
650
|
});
|
|
594
651
|
return groups.length === 1 ? groups[0] : groups;
|
|
595
652
|
}
|
|
596
|
-
export function unparsedFunction(token, builder) {
|
|
597
|
-
return [{}, token.value.name, reduceParseUnparsed(token.value.arguments, builder)];
|
|
653
|
+
export function unparsedFunction(token, builder, property, allowAuto) {
|
|
654
|
+
return [{}, token.value.name, reduceParseUnparsed(token.value.arguments, builder, property, allowAuto)];
|
|
598
655
|
}
|
|
599
656
|
|
|
600
657
|
/**
|
|
601
658
|
* When the CSS cannot be parsed (often due to a runtime condition like a CSS variable)
|
|
602
659
|
* This export function best efforts parsing it into a export function that we can evaluate at runtime
|
|
603
660
|
*/
|
|
604
|
-
export function parseUnparsed(tokenOrValue, builder, allowAuto =
|
|
661
|
+
export function parseUnparsed(tokenOrValue, builder, property, allowAuto = allowAutoProperties.has(property)) {
|
|
605
662
|
if (tokenOrValue === undefined || tokenOrValue === null) {
|
|
606
663
|
return;
|
|
607
664
|
}
|
|
@@ -620,7 +677,7 @@ export function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
|
|
|
620
677
|
return round(tokenOrValue);
|
|
621
678
|
}
|
|
622
679
|
if (Array.isArray(tokenOrValue)) {
|
|
623
|
-
const args = reduceParseUnparsed(tokenOrValue, builder);
|
|
680
|
+
const args = reduceParseUnparsed(tokenOrValue, builder, property, allowAuto);
|
|
624
681
|
if (!args) return;
|
|
625
682
|
if (Array.isArray(args) && args.length === 1) return args[0];
|
|
626
683
|
return args;
|
|
@@ -628,12 +685,12 @@ export function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
|
|
|
628
685
|
switch (tokenOrValue.type) {
|
|
629
686
|
case "unresolved-color":
|
|
630
687
|
{
|
|
631
|
-
return parseUnresolvedColor(tokenOrValue.value, builder);
|
|
688
|
+
return parseUnresolvedColor(tokenOrValue.value, builder, property, allowAuto);
|
|
632
689
|
}
|
|
633
690
|
case "var":
|
|
634
691
|
{
|
|
635
692
|
let args = tokenOrValue.value.name.ident.slice(2);
|
|
636
|
-
const fallback = parseUnparsed(tokenOrValue.value.fallback, builder);
|
|
693
|
+
const fallback = parseUnparsed(tokenOrValue.value.fallback, builder, property, allowAuto);
|
|
637
694
|
if (fallback !== undefined) {
|
|
638
695
|
args = [args, fallback];
|
|
639
696
|
}
|
|
@@ -654,7 +711,8 @@ export function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
|
|
|
654
711
|
case "translateX":
|
|
655
712
|
case "translateY":
|
|
656
713
|
tokenOrValue.value.name = `@${tokenOrValue.value.name}`;
|
|
657
|
-
return unparsedFunction(tokenOrValue, builder);
|
|
714
|
+
return unparsedFunction(tokenOrValue, builder, property, allowAuto);
|
|
715
|
+
case "blur":
|
|
658
716
|
case "brightness":
|
|
659
717
|
case "contrast":
|
|
660
718
|
case "cubic-bezier":
|
|
@@ -678,17 +736,17 @@ export function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
|
|
|
678
736
|
case "sepia":
|
|
679
737
|
case "shadow":
|
|
680
738
|
case "steps":
|
|
681
|
-
return unparsedFunction(tokenOrValue, builder);
|
|
739
|
+
return unparsedFunction(tokenOrValue, builder, property, allowAuto);
|
|
682
740
|
case "hairlineWidth":
|
|
683
741
|
return [{}, tokenOrValue.value.name, []];
|
|
684
742
|
case "calc":
|
|
685
743
|
case "max":
|
|
686
744
|
case "min":
|
|
687
745
|
case "clamp":
|
|
688
|
-
return parseCalcFn(tokenOrValue.value.name, tokenOrValue.value.arguments, builder);
|
|
746
|
+
return parseCalcFn(tokenOrValue.value.name, tokenOrValue.value.arguments, builder, property);
|
|
689
747
|
default:
|
|
690
748
|
{
|
|
691
|
-
builder.addWarning("
|
|
749
|
+
builder.addWarning("value", `${tokenOrValue.value.name}()`);
|
|
692
750
|
return;
|
|
693
751
|
}
|
|
694
752
|
}
|
|
@@ -734,11 +792,17 @@ export function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
|
|
|
734
792
|
return parseDimension(tokenOrValue.value, builder);
|
|
735
793
|
case "comma":
|
|
736
794
|
return CommaSeparator;
|
|
795
|
+
case "delim":
|
|
796
|
+
{
|
|
797
|
+
if (property === "aspect-ratio" && tokenOrValue.value.value === "/") {
|
|
798
|
+
return tokenOrValue.value.value;
|
|
799
|
+
}
|
|
800
|
+
return;
|
|
801
|
+
}
|
|
737
802
|
case "at-keyword":
|
|
738
803
|
case "hash":
|
|
739
804
|
case "id-hash":
|
|
740
805
|
case "unquoted-url":
|
|
741
|
-
case "delim":
|
|
742
806
|
case "white-space":
|
|
743
807
|
case "comment":
|
|
744
808
|
case "colon":
|
|
@@ -791,22 +855,30 @@ export function parseLength(length, builder) {
|
|
|
791
855
|
inlineRem = 14
|
|
792
856
|
} = builder.getOptions();
|
|
793
857
|
if (typeof length === "number") {
|
|
794
|
-
return length;
|
|
858
|
+
return round(length);
|
|
795
859
|
}
|
|
796
860
|
if ("unit" in length) {
|
|
797
861
|
switch (length.unit) {
|
|
798
862
|
case "px":
|
|
799
|
-
|
|
863
|
+
{
|
|
864
|
+
if (length.value === Infinity) {
|
|
865
|
+
return 9999;
|
|
866
|
+
} else if (length.value === -Infinity) {
|
|
867
|
+
return -9999;
|
|
868
|
+
} else {
|
|
869
|
+
return round(length.value);
|
|
870
|
+
}
|
|
871
|
+
}
|
|
800
872
|
case "rem":
|
|
801
873
|
if (typeof inlineRem === "number") {
|
|
802
874
|
return length.value * inlineRem;
|
|
803
875
|
} else {
|
|
804
|
-
return [{}, "rem", length.value];
|
|
876
|
+
return [{}, "rem", round(length.value)];
|
|
805
877
|
}
|
|
806
878
|
case "vw":
|
|
807
879
|
case "vh":
|
|
808
880
|
case "em":
|
|
809
|
-
return [{}, length.unit, length.value, 1];
|
|
881
|
+
return [{}, length.unit, round(length.value), 1];
|
|
810
882
|
case "in":
|
|
811
883
|
case "cm":
|
|
812
884
|
case "mm":
|
|
@@ -891,7 +963,7 @@ export function parseAngle(angle, builder) {
|
|
|
891
963
|
case "rad":
|
|
892
964
|
return `${angle.value}${angle.type}`;
|
|
893
965
|
default:
|
|
894
|
-
builder.addWarning("value", angle.value);
|
|
966
|
+
builder.addWarning("value", `${angle.value} ${angle.type}`);
|
|
895
967
|
return undefined;
|
|
896
968
|
}
|
|
897
969
|
}
|
|
@@ -949,7 +1021,7 @@ export function parseSize(size, builder, options, {
|
|
|
949
1021
|
}
|
|
950
1022
|
return;
|
|
951
1023
|
}
|
|
952
|
-
export function
|
|
1024
|
+
export function parseColorOrAutoDeclaration({
|
|
953
1025
|
value
|
|
954
1026
|
}, builder) {
|
|
955
1027
|
if (value.type === "auto") {
|
|
@@ -1339,19 +1411,27 @@ export function parseBorderStyle(value, builder) {
|
|
|
1339
1411
|
builder.addWarning("value", value.top);
|
|
1340
1412
|
return undefined;
|
|
1341
1413
|
}
|
|
1342
|
-
export function parseBorderBlockColor({
|
|
1343
|
-
value
|
|
1344
|
-
}, builder) {
|
|
1345
|
-
builder.addDescriptor("border-top-color", parseColor(value.start, builder));
|
|
1346
|
-
builder.addDescriptor("border-bottom-color", parseColor(value.end, builder));
|
|
1347
|
-
return;
|
|
1348
|
-
}
|
|
1349
1414
|
export function parseBorderBlockWidth(declaration, builder) {
|
|
1350
1415
|
builder.addDescriptor("border-top-width", parseBorderSideWidth(declaration.value.start, builder));
|
|
1351
1416
|
builder.addDescriptor("border-bottom-width", parseBorderSideWidth(declaration.value.end, builder));
|
|
1352
1417
|
}
|
|
1418
|
+
function parseBorderBlockStyle(declaration, builder) {
|
|
1419
|
+
if (declaration.value.start === declaration.value.end) {
|
|
1420
|
+
builder.addDescriptor("border-style", parseBorderStyle(declaration.value.start, builder));
|
|
1421
|
+
} else {
|
|
1422
|
+
builder.addWarning("property", "border-block-style");
|
|
1423
|
+
}
|
|
1424
|
+
}
|
|
1353
1425
|
export function parseBorderSideWidthDeclaration(declaration, builder) {
|
|
1354
|
-
|
|
1426
|
+
if (declaration.property.includes("block")) {
|
|
1427
|
+
builder.addDescriptor(`border-${declaration.property.includes("start") ? "top" : "bottom"}-width`, parseBorderSideWidth(declaration.value, builder));
|
|
1428
|
+
return;
|
|
1429
|
+
} else if (declaration.property.includes("inline")) {
|
|
1430
|
+
builder.addDescriptor(`border-${declaration.property.includes("start") ? "left" : "right"}-width`, parseBorderSideWidth(declaration.value, builder));
|
|
1431
|
+
return;
|
|
1432
|
+
} else {
|
|
1433
|
+
return parseBorderSideWidth(declaration.value, builder);
|
|
1434
|
+
}
|
|
1355
1435
|
}
|
|
1356
1436
|
export function parseBorderSideWidth(value, builder) {
|
|
1357
1437
|
if (value.type === "length") {
|
|
@@ -1396,7 +1476,7 @@ export function parseLineHeight(value, builder) {
|
|
|
1396
1476
|
return parseLength(length, builder);
|
|
1397
1477
|
case "percentage":
|
|
1398
1478
|
case "calc":
|
|
1399
|
-
builder.addWarning("
|
|
1479
|
+
builder.addWarning("style", "line-height", typeof length.value === "number" ? length.value : JSON.stringify(length.value));
|
|
1400
1480
|
return;
|
|
1401
1481
|
default:
|
|
1402
1482
|
{
|
|
@@ -1583,7 +1663,11 @@ export function parseDimension({
|
|
|
1583
1663
|
}, builder) {
|
|
1584
1664
|
switch (unit) {
|
|
1585
1665
|
case "px":
|
|
1586
|
-
|
|
1666
|
+
if (value === Infinity) {
|
|
1667
|
+
return 9999;
|
|
1668
|
+
} else {
|
|
1669
|
+
return value;
|
|
1670
|
+
}
|
|
1587
1671
|
case "%":
|
|
1588
1672
|
return `${value}%`;
|
|
1589
1673
|
case "rnh":
|
|
@@ -1608,17 +1692,24 @@ export function parseUserSelect({
|
|
|
1608
1692
|
}
|
|
1609
1693
|
}
|
|
1610
1694
|
export function parseSVGPaint({
|
|
1611
|
-
value
|
|
1695
|
+
value,
|
|
1696
|
+
property
|
|
1612
1697
|
}, builder) {
|
|
1698
|
+
let parsedValue;
|
|
1613
1699
|
if (value.type === "none") {
|
|
1614
|
-
|
|
1700
|
+
parsedValue = "transparent";
|
|
1615
1701
|
} else if (value.type === "color") {
|
|
1616
|
-
|
|
1702
|
+
parsedValue = parseColor(value.value, builder);
|
|
1703
|
+
} else {
|
|
1704
|
+
return;
|
|
1617
1705
|
}
|
|
1618
|
-
|
|
1706
|
+
builder.addMapping({
|
|
1707
|
+
[property]: [property]
|
|
1708
|
+
});
|
|
1709
|
+
builder.addDescriptor(property, parsedValue);
|
|
1619
1710
|
}
|
|
1620
1711
|
export function round(number) {
|
|
1621
|
-
return Math.round((number + Number.EPSILON) *
|
|
1712
|
+
return Math.round((number + Number.EPSILON) * 10000) / 10000;
|
|
1622
1713
|
}
|
|
1623
1714
|
export function parseDimensionPercentageFor_LengthValue(value, builder) {
|
|
1624
1715
|
if (value.type === "calc") {
|
|
@@ -1629,7 +1720,7 @@ export function parseDimensionPercentageFor_LengthValue(value, builder) {
|
|
|
1629
1720
|
return parseLength(value.value, builder);
|
|
1630
1721
|
}
|
|
1631
1722
|
}
|
|
1632
|
-
const
|
|
1723
|
+
const allowAutoProperties = new Set(["pointer-events"]);
|
|
1633
1724
|
export function parseEnv(value, builder) {
|
|
1634
1725
|
switch (value.name.type) {
|
|
1635
1726
|
case "ua":
|
|
@@ -1638,7 +1729,7 @@ export function parseEnv(value, builder) {
|
|
|
1638
1729
|
case "safe-area-inset-right":
|
|
1639
1730
|
case "safe-area-inset-bottom":
|
|
1640
1731
|
case "safe-area-inset-left":
|
|
1641
|
-
return [{}, "var", [`--react-native-css-${value.name.value}`, parseUnparsed(value.fallback, builder)], 1];
|
|
1732
|
+
return [{}, "var", [`--react-native-css-${value.name.value}`, parseUnparsed(value.fallback, builder, value.name.value)], 1];
|
|
1642
1733
|
case "viewport-segment-width":
|
|
1643
1734
|
case "viewport-segment-height":
|
|
1644
1735
|
case "viewport-segment-top":
|
|
@@ -1652,14 +1743,14 @@ export function parseEnv(value, builder) {
|
|
|
1652
1743
|
}
|
|
1653
1744
|
return;
|
|
1654
1745
|
}
|
|
1655
|
-
export function parseCalcFn(name, tokens, builder) {
|
|
1656
|
-
const args = parseCalcArguments(tokens, builder);
|
|
1746
|
+
export function parseCalcFn(name, tokens, builder, property) {
|
|
1747
|
+
const args = parseCalcArguments(tokens, builder, property);
|
|
1657
1748
|
if (args) {
|
|
1658
1749
|
return [{}, name, args];
|
|
1659
1750
|
}
|
|
1660
1751
|
return;
|
|
1661
1752
|
}
|
|
1662
|
-
export function parseCalcArguments([...args], builder) {
|
|
1753
|
+
export function parseCalcArguments([...args], builder, property) {
|
|
1663
1754
|
const parsed = [];
|
|
1664
1755
|
let mode;
|
|
1665
1756
|
for (const [currentIndex, arg] of args.entries()) {
|
|
@@ -1673,7 +1764,7 @@ export function parseCalcArguments([...args], builder) {
|
|
|
1673
1764
|
case "function":
|
|
1674
1765
|
case "unresolved-color":
|
|
1675
1766
|
{
|
|
1676
|
-
const value = parseUnparsed(arg, builder);
|
|
1767
|
+
const value = parseUnparsed(arg, builder, property);
|
|
1677
1768
|
if (value === undefined) {
|
|
1678
1769
|
return undefined;
|
|
1679
1770
|
}
|
|
@@ -1742,7 +1833,7 @@ export function parseCalcArguments([...args], builder) {
|
|
|
1742
1833
|
.splice(currentIndex, closeParenthesisIndex - currentIndex + 1)
|
|
1743
1834
|
// Then drop the surrounding parenthesis
|
|
1744
1835
|
.slice(1, -1);
|
|
1745
|
-
parsed.push(parseCalcFn("calc", innerCalcArgs, builder));
|
|
1836
|
+
parsed.push(parseCalcFn("calc", innerCalcArgs, builder, property));
|
|
1746
1837
|
break;
|
|
1747
1838
|
}
|
|
1748
1839
|
case "close-parenthesis":
|
|
@@ -1783,20 +1874,20 @@ export function parseTranslateProp(value, prop, builder) {
|
|
|
1783
1874
|
}
|
|
1784
1875
|
return parseLength(value[prop], builder);
|
|
1785
1876
|
}
|
|
1786
|
-
export function parseUnresolvedColor(color, builder) {
|
|
1877
|
+
export function parseUnresolvedColor(color, builder, property, allowAuto) {
|
|
1787
1878
|
switch (color.type) {
|
|
1788
1879
|
case "rgb":
|
|
1789
|
-
return [{}, "rgba", [round(color.r * 255), round(color.g * 255), round(color.b * 255), parseUnparsed(color.alpha, builder)]];
|
|
1880
|
+
return [{}, "rgba", [round(color.r * 255), round(color.g * 255), round(color.b * 255), parseUnparsed(color.alpha, builder, property)]];
|
|
1790
1881
|
case "hsl":
|
|
1791
|
-
return [{}, color.type, [color.h, color.s, color.l, parseUnparsed(color.alpha, builder)]];
|
|
1882
|
+
return [{}, color.type, [color.h, color.s, color.l, parseUnparsed(color.alpha, builder, property)]];
|
|
1792
1883
|
case "light-dark":
|
|
1793
1884
|
{
|
|
1794
1885
|
const extraRule = builder.extendRule({
|
|
1795
1886
|
m: [["=", "prefers-color-scheme", "dark"]]
|
|
1796
1887
|
});
|
|
1797
|
-
builder.addUnnamedDescriptor(reduceParseUnparsed(color.dark, builder), false, extraRule);
|
|
1888
|
+
builder.addUnnamedDescriptor(reduceParseUnparsed(color.dark, builder, property, allowAuto), false, extraRule);
|
|
1798
1889
|
builder.addExtraRule(extraRule);
|
|
1799
|
-
return reduceParseUnparsed(color.light, builder);
|
|
1890
|
+
return reduceParseUnparsed(color.light, builder, property, allowAuto);
|
|
1800
1891
|
}
|
|
1801
1892
|
default:
|
|
1802
1893
|
color;
|