Skip to content

[babel-plugin] Fix paddingInline not resetting paddingInlineStart/End in application-order - #2020

Draft
henryqdineen wants to merge 1 commit into
meta:mainfrom
henryqdineen:hqd-fix-padding-inline-application-order
Draft

henryqdineen wants to merge 1 commit into
meta:mainfrom
henryqdineen:hqd-fix-padding-inline-application-order

Conversation

@henryqdineen

Copy link
Copy Markdown
Collaborator

What changed / motivation ?

With styleResolution: 'application-order', a later padding or paddingInline didn't override an earlier paddingInlineStart/paddingInlineEnd. Both classes stayed in the resolved className, and because the longhand is emitted at higher specificity, the earlier value won.

The cause is what we assume is a typo in the paddingInline expansion in application-order.js: it reset paddingStart/paddingEnd instead of paddingInlineStart/paddingInlineEnd. marginInline, and the paddingInline expansion in legacy-expand-shorthands.js, already use the correct names. padding reuses the paddingInline expansion, so this one change fixes both.

HubSpot uses application-order, which is why I picked this up. We haven't hit it in practice, but it's an easy pattern to fall into (a base style with paddingInlineEnd, overridden by a padding reset).

Linked PR/Issues

Fixes #2018

Additional Context

Tests added in __tests__/legacy/stylex-transform-call-test.js:

  • padding and paddingInline applied after paddingInlineStart and after paddingInlineEnd now resolve to only the shorthand's class
  • The same cases for margin/marginInline, which already behaved correctly, as a comparison

Existing snapshots updated:

  • stylex call with short-form property collisions and ... with null had the bug in their expected output (e.g. "x2vl965 x1i3ajwb" kept padding-inline-end:10px after a later padding:2px); they now resolve to "x1i3ajwb xe2zdcy" and "x1i3ajwb"
  • Two stylex.create snapshots change which hashed keys padding sets to null, because the reset now targets the correct properties

I also checked the other expansions in application-order.js for the same mistake (resetting a name that only exists as an alias) and found no others.

Pre-flight checklist

🤖 Generated with Claude Code

With styleResolution: 'application-order', applying `padding` or
`paddingInline` after `paddingInlineStart`/`paddingInlineEnd` left the
earlier longhand's class in the className, and because it is emitted at
higher specificity it won the cascade over the later shorthand.

The `paddingInline` expansion nulled `paddingStart`/`paddingEnd`, what we
assume is a typo for `paddingInlineStart`/`paddingInlineEnd` (`marginInline`
and the legacy `paddingInline` expansion already use the correct names).
`padding` reuses this expansion, so both are fixed.

Fixes meta#2018

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 8, 2026

Copy link
Copy Markdown

@henryqdineen is attempting to deploy a commit to the Meta Open Source Team on Vercel.

A member of the Team first needs to authorize it.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 8, 2026

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

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

1 participant