Skip to content

Commit d481d5b

Browse files
committed
ensure units can be lower and uppercase
1 parent eb0ec12 commit d481d5b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/tailwindcss/src/utils/math-operators.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
const LOWER_A = 0x61
22
const LOWER_Z = 0x7a
3+
const UPPER_A = 0x41
4+
const UPPER_Z = 0x5a
35
const LOWER_E = 0x65
46
const UPPER_E = 0x45
57
const ZERO = 0x30
@@ -63,7 +65,12 @@ export function addWhitespaceAroundMathOperators(input: string) {
6365

6466
// If we saw a number before, and we see normal a-z character, then we
6567
// assume this is a value such as `123px`
66-
else if (valuePos !== null && ((char >= LOWER_A && char <= LOWER_Z) || char === PERCENT)) {
68+
else if (
69+
valuePos !== null &&
70+
(char === PERCENT ||
71+
(char >= LOWER_A && char <= LOWER_Z) ||
72+
(char >= UPPER_A && char <= UPPER_Z))
73+
) {
6774
valuePos = i
6875
}
6976

0 commit comments

Comments
 (0)