Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ensure units can be lower and uppercase
  • Loading branch information
RobinMalfait committed Jun 11, 2025
commit d481d5ba9025f42e4d3cba0fe5a40711eb1f78fd
9 changes: 8 additions & 1 deletion packages/tailwindcss/src/utils/math-operators.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const LOWER_A = 0x61
const LOWER_Z = 0x7a
const UPPER_A = 0x41
const UPPER_Z = 0x5a
const LOWER_E = 0x65
const UPPER_E = 0x45
const ZERO = 0x30
Expand Down Expand Up @@ -63,7 +65,12 @@ export function addWhitespaceAroundMathOperators(input: string) {

// If we saw a number before, and we see normal a-z character, then we
// assume this is a value such as `123px`
else if (valuePos !== null && ((char >= LOWER_A && char <= LOWER_Z) || char === PERCENT)) {
else if (
valuePos !== null &&
(char === PERCENT ||
(char >= LOWER_A && char <= LOWER_Z) ||
(char >= UPPER_A && char <= UPPER_Z))
) {
valuePos = i
}

Expand Down