Conversation
added 10 commits
April 3, 2026 13:45
…d-shorthands Expand logical border shorthands into their longhand equivalents. These properties currently hard-error in stylex-valid-styles via showError with no autofix path. Tier 1 — 3-part border expansion (width/style/color): borderInlineEnd, borderInlineStart, borderBlockEnd, borderBlockStart, borderInline, borderBlock Tier 2 — 2-value sub-shorthand expansion (start/end): borderInlineColor, borderInlineStyle, borderInlineWidth, borderBlockColor, borderBlockStyle, borderBlockWidth
…o stylex-valid-shorthands
…pansion to stylex-valid-shorthands
…nsion to stylex-valid-shorthands
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
workflow: benchmarks/perfComparison of performance test results, measured in operations per second. Larger is better.
|
workflow: benchmarks/sizeComparison of minified (terser) and compressed (brotli) size results, measured in bytes. Smaller is better.
|
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.
Adds shorthand expansion autofixers to
stylex-valid-shorthandsfor 15+ CSS shorthand properties that were previously unsupported. Each shorthand follows the samecreateSpecificTransformerpattern used by existing handlers (border, gap, flex, animation, etc.).What changed / motivation ?
The
stylex-valid-shorthandsrule already auto-fixedborder,borderTop/Right/Bottom/Left,margin,padding,flex,gap,animation,font,outline,background, and grid properties. This PR extends coverage to the remaining common shorthands:Logical border shorthands:
borderInlineEnd,borderInlineStart,borderBlockEnd,borderBlockStart→ Width/Style/Color longhandsborderInline,borderBlock→ Width/Style/Color longhandsborderInlineColor/Style/Width,borderBlockColor/Style/Width→ Start/End longhandsLayout shorthands:
overflow: 'hidden scroll'→overflowX: 'hidden'+overflowY: 'scroll'overscrollBehavior: 'contain auto'→overscrollBehaviorX+overscrollBehaviorYinset: '0 10px'→insetBlock+insetInline(2-value);top/right/bottom/left(3-4 value)insetBlock/insetInline→ Start/End longhandsplaceContent: 'center space-between'→alignContent+justifyContentplaceItems/placeSelf→ align/justify longhandsflexFlow: 'row wrap'→flexDirection+flexWrap(with token validation)Other shorthands:
columnRule: '1px solid red'→columnRuleWidth+columnRuleStyle+columnRuleColorcolumns: '200px 3'→columnWidth+columnCount(with integer/length disambiguation)listStyle: 'disc inside url(bullet.png)'→listStyleType+listStylePosition+listStyleImagecaret: 'red bar'→caretColor+caretShapetextDecoration: 'underline solid red 2px'→textDecorationLine+textDecorationStyle+textDecorationColor+textDecorationThicknessAll handlers:
CANNOT_FIXfor ambiguous/unparseable values (commas, slashes, too many tokens)!importantwhenallowImportantis enabledLinked PR/Issues
Follow-up to #1553, #1552, #1538, #1537
Additional Context
Tests:
npx jest --watchman=false stylex-valid-shorthands-test.js— all 569 tests pass.Files changed: 3
src/stylex-valid-shorthands.js— register new shorthands inshorthandAliasessrc/utils/splitShorthands.js— expansion logic for each shorthand__tests__/stylex-valid-shorthands-test.js— ~1250 new lines of test coveragePre-flight checklist
Contribution Guidelines