Skip to content

Commit 222633c

Browse files
committed
remove unnecessary percentage handling
We already constant fold declarations, including normalization of `0.00%` to just `0%`. So we don't need this code anymore.
1 parent a0228f8 commit 222633c

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

packages/tailwindcss/src/signatures.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import { isValidSpacingMultiplier } from './utils/infer-data-type'
1111
import * as ValueParser from './value-parser'
1212
import { walk, WalkAction } from './walk'
1313

14-
const FLOATING_POINT_PERCENTAGE = /\d*\.\d+(?:[eE][+-]?\d+)?%/g
15-
1614
export enum SignatureFeatures {
1715
None = 0,
1816
ExpandProperties = 1 << 0,
@@ -113,17 +111,6 @@ function canonicalizeAst(ast: AstNode[], options: SignatureOptions) {
113111
if (replacement) return WalkAction.Replace(replacement)
114112
}
115113

116-
// Normalize percentages by removing unnecessary dots and zeros.
117-
//
118-
// E.g.: `50.0%` → `50%`
119-
if (node.value.includes('%')) {
120-
FLOATING_POINT_PERCENTAGE.lastIndex = 0
121-
node.value = node.value.replaceAll(
122-
FLOATING_POINT_PERCENTAGE,
123-
(match) => `${Number(match.slice(0, -1))}%`,
124-
)
125-
}
126-
127114
// Resolve theme values to their inlined value.
128115
if (node.value.includes('var(')) {
129116
node.value = resolveVariablesInValue(node.value, designSystem)

0 commit comments

Comments
 (0)