Skip to content

Commit a90b209

Browse files
Adjust handling of zero values to preserve CSS clamp() compatibility (#106)
This change addresses an issue where CSS clamp() functions were breaking because they require a unit to clamp properly. Removing this conditional ensures that the unit is included even when the value is zero, allowing clamp() functions to work correctly with zero values.
1 parent 6cf23c4 commit a90b209

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function createPxReplace(rootValue, unitPrecision, minPixelValue) {
5050
const pixels = parseFloat($1);
5151
if (pixels < minPixelValue) return m;
5252
const fixedVal = toFixed(pixels / rootValue, unitPrecision);
53-
return fixedVal === 0 ? "0" : fixedVal + "rem";
53+
return fixedVal + "rem";
5454
};
5555
}
5656

0 commit comments

Comments
 (0)