Skip to content

fix: don't add px to aspectRatio, fontSizeAdjust and vendor-prefixed unitless properties - #1809

Open
bardrop wants to merge 1 commit into
vanilla-extract-css:masterfrom
bardrop-oss:fix-unitless-aspect-ratio
Open

bardrop wants to merge 1 commit into
vanilla-extract-css:masterfrom
bardrop-oss:fix-unitless-aspect-ratio

Conversation

@bardrop

@bardrop bardrop commented Nov 14, 2026

Copy link
Copy Markdown

pixelifyProperties adds px to any number whose key isn't in UNITLESS, so a few number-only properties came out invalid:

style({ aspectRatio: 16 / 9, fontSizeAdjust: 0.5, WebkitBoxFlex: 1, msFlex: 1 });
// aspect-ratio: 1.7777777777777777px;
// font-size-adjust: 0.5px;
// -webkit-box-flex: 1px;
// -ms-flex: 1px;

Changes:

  • Added aspectRatio and fontSizeAdjust to UNITLESS. Both take a <number>, never a <length>.
  • Vendor-prefixed keys (Webkit, Moz, ms, O) are now looked up by their unprefixed name too, so WebkitBoxFlex, WebkitFlexGrow, MozBoxOrdinalGroup, msFlex etc. follow their standard property. Prefixed length properties like MozPaddingStart still get px. WebkitLineClamp no longer needs its own entry since lineClamp covers it.

Added a transformCss test for these cases (fails on master). vitest for packages/css, tsc, oxlint and prettier pass. Changeset included.

Fixes #1808

@changeset-bot

changeset-bot Bot commented Nov 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: fe811e9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@vanilla-extract/css Patch

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

@bardrop

bardrop commented Nov 23, 2026

Copy link
Copy Markdown
Author

This one has been quiet for a week. It is a small change: two entries in UNITLESS plus vendor-prefixed keys, with tests and a changeset. Happy to split out the vendor-prefix part if you only want the first.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Numeric aspectRatio (and fontSizeAdjust, prefixed flex properties) get a px suffix

1 participant