Repository navigation
[babel-plugin] Treat initialLetter as a unitless number - #2021
Draft
henryqdineen wants to merge 1 commit into
Draft
henryqdineen wants to merge 1 commit into
henryqdineen wants to merge 1 commit into
Conversation
`initialLetter: 3` compiled to `initial-letter:3px`, which is invalid CSS, so browsers dropped the declaration. The size argument is a plain `<number>`, so it should never get a `px` suffix. The Flow/TS types and the eslint valid-styles rule already reject numeric `initialLetter`, so this only affects untyped, unlinted code. Fixes meta#2019 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@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. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed / motivation ?
initialLetter: 3compiles toinitial-letter:3px, which is invalid CSS, so browsers drop the declaration and the drop cap is ignored. The size argument ofinitial-letteris a plain<number>(fractional values like3.5are allowed), so it should never get apxsuffix. This addsinitialLettertounitlessNumberProperties, the same fix as #1903 forfontSizeAdjust.This is an edge case: the Flow/TS types (
'normal' | string) and the eslintvalid-stylesrule both already reject a numericinitialLetter, so only untyped, unlinted code can hit it. The string forms ('3','3 2') already work and are unchanged.Linked PR/Issues
Fixes #2019
Additional Context
Tests: added
initialLetter: 3.5to the existing unitless case intransform-value-normalization-test.js; it now emitsinitial-letter:3.5.Pre-flight checklist
🤖 Generated with Claude Code