We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 172a683 commit 4af17f5Copy full SHA for 4af17f5
src/compiler/declarations.ts
@@ -1202,6 +1202,8 @@ export function parseUnparsed(
1202
return true;
1203
} else if (value === "false") {
1204
return false;
1205
+ } else if (value === "infinity") {
1206
+ return Number.MAX_SAFE_INTEGER;
1207
} else {
1208
return value;
1209
}
@@ -1309,7 +1311,12 @@ export function parseLength(
1309
1311
} else if (length.value === -Infinity) {
1310
1312
return -9999;
1313
- return round(length.value);
1314
+ // Normalize large values to safe integers, e.g. `calc(infinity * 1px)`
1315
+ const value = Math.max(
1316
+ Math.min(length.value, Number.MAX_SAFE_INTEGER),
1317
+ Number.MIN_SAFE_INTEGER,
1318
+ );
1319
+ return round(value);
1320
1321
1322
case "rem":
0 commit comments