Repository navigation
fix: treat fontSizeAdjust, initialLetter, mathDepth, shapeImageThreshold as unitless (#5871) - #5872
Conversation
🦋 Changeset detectedLatest commit: 8ca2ee4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
ℹ️ No critical issues — three minor suggestions inline.
Reviewed changes — one commit expanding the object-style unitless set, with a unit test and a changeset. All four properties accept a bare number in their current specs, and the shared native path compiles to the same value before and after.
- Unitless set —
fontSizeAdjust,initialLetter,mathDepth, andshapeImageThresholdnow emit withoutpxfor numeric object-style values. - Tests — four assertions added to the existing "does not add a px prefix for unitless properties" case.
- Changeset — patch entry for
styled-componentsdocumenting the four properties.
deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏
Also quote each property's spec Value line above its test and note the class name change in the changeset.
|
Pushed 8ca2ee4: added |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — the delta since the prior pullfrog review (9292102a): the unitless set picked up the remaining same-class properties, and the new assertions gained normative citations.
- Expanded unitless set —
hyphenateLimitCharsand themaskBorderOutset/maskBorderSlice/maskBorderWidthaliases ofborderImage*join the four original properties, with the file docblock updated to match. - Spec-quoted tests — a dedicated case quotes each property's current
Value:line (MathML Core formath-depth) and asserts the bare number survives, matching the citation style already used forgrid-area/line-clamp. - Changeset — the entry lists all eight properties and notes that affected components get a new class name on upgrade.
Re-fetched css-text-4 and css-masking-1 to confirm the new quotes, ran addUnitIfNeeded.test.ts (5/5 passing), and checked both changed source files with Biome; all clean. The native path still compiles to the same value because native/transform/units.ts accepts an optional px and none of these properties has a native transform or polyfill.
ℹ️ GitHub took this as a comment because it requires explicit repository access to approve or block a pull request here.
deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏
|
Thanks @EnesKartal, appreciate the thorough follow-up with the extra properties and spec references. Merging this for v7 and backporting to 6.x. |

Summary
Adds
fontSizeAdjust,initialLetter,mathDepth, andshapeImageThresholdto theunitlessCSS property set inpackages/styled-components/src/utils/addUnitIfNeeded.ts.Closes #5871
Changes
unitlessSet with the 4 standard unitless CSS properties.packages/styled-components/src/utils/test/addUnitIfNeeded.test.ts.@styled-components.Verification
pnpx jest src/utils/test/addUnitIfNeeded.test.ts -c jest.config.main.js-> 4/4 passingpnpm --filter styled-components typecheck-> cleanpnpm format:check(biome ci) -> clean