fix(tailwind): split two-value logical shorthands with auto/var/calc#3595
Open
yashs33244 wants to merge 1 commit into
Open
fix(tailwind): split two-value logical shorthands with auto/var/calc#3595yashs33244 wants to merge 1 commit into
yashs33244 wants to merge 1 commit into
Conversation
separteShorthandDeclaration only counted Dimension/Number/Percentage value components, so a two-value margin-inline/padding-inline with a non-numeric side (auto, var(), calc()) was seen as one value and not split - both longhands got the full two-value string, which is invalid. Count every non-operator/whitespace component instead.
Contributor
|
@yashs33244 is attempting to deploy a commit to the resend Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: cd6e74e The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
Contributor
There was a problem hiding this comment.
No issues found across 3 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Auto-approved: Fixes a bug in logical shorthand splitting for non-numeric values (auto, var, calc). Changes are isolated, well-tested, and low-risk.
Re-trigger cubic
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
separteShorthandDeclarationsplits logical shorthands (margin-inline,margin-block,padding-inline,padding-block) into per-side longhands for email-client compatibility. It decides whether a value has one or two parts by filtering the value's children toDimension | Number | Percentage:A non-numeric component like
auto,var(...)orcalc(...)is dropped by that filter, so a genuinely two-value shorthand looks like one value and is not split. Both longhands then receive the full two-value string, which is invalid:Fix
Count every real value component (everything that isn't an
Operator/WhiteSpace) so the two parts are detected and split correctly:Single values (
margin-inline: auto,mx-auto) and existing numeric two-value cases are unchanged. Added regression tests; all tailwind tests pass.Summary by cubic
Fixes splitting of two-value logical shorthands (
margin-inline,padding-inline) when one side isauto,var(), orcalc(), so we emit valid per-side longhands for email clients.1rem auto,0 auto, and10px calc(1rem + 2px)inreact-email.Written for commit cd6e74e. Summary will update on new commits.