Repository navigation
Conversation
Contributor
|
@Maliik-B 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: bf13b20 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 |
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.
Related issue or discussion
Fixes #3953.
What this changes
sanitizeNonInlinableRulesnow replaces eachvar(--tw-*, <fallback>)in the rules that go to the<style>with its fallback, run throughsanitizeDeclarations, the waymakeInlineStylesForalready treats fallbacks for inline styles (#3768). Nothing<Tailwind>writes can define those variables: this function already removes them from<style>rules (#3542), and inline styles never carry custom properties. So a client that resolves thevar()always lands on the fallback anyway. User variables are left alone (--tw-only, the same scope asstripEmptyTailwindVars).A variant shadow now writes
rgb(0,0,0,0.1)instead ofvar(--tw-shadow-color, rgb(0 0 0 / 0.1)), and Gmail keeps the<style>. Gmail web, the issue's email built from this branch, where themd:box keeps its fill:Of the 18,881 classes in Tailwind's class list, under
md:60 change and nothing else does: the 12 box and inset shadows; the 12ringandinset-ringwidths, whosevar(--tw-ring-color, currentcolor)(or--tw-inset-ring-color) becomescurrentcolor; and 36 mask utilities, whosevar(--tw-mask-*-stops, var(--tw-mask-*-position))becomes the inner variable. No existing test changes.With #3951,
hover:shadow-lg/20comes out asrgb(0,0,0,0.2)too; without it the fallback is substituted but staysoklab(from …). This merges cleanly with #3933, #3937 and #3951.Not addressed:
<style>, as before this PR. Undermd:,md:shadow-red-500's--tw-shadow-coloris removed with the other--tw-*declarations (fix(tailwind): tw-* variables in non inlined rules #3542), so the shadow keeps the default color. Underhover:withtailwindcss4.1.x (the lockfile's version),hover:rules pick up each other's variables, sohover:shadow-md hover:shadow-red-500writes the color as acolor-mix(), which Gmail also drops from a<style>; with 4.3.x nothing is picked up. That is also why the<Tailwind>test below usesmd:.<style>: the barevar(--tw-inset-shadow)and the others in the same rule have no fallback, so the declaration is invalid (checked in Chromium, WebKit and Firefox). Fixing that means using Tailwind's registered initial values for every variant class with a barevar(), so it gets its own issue.Tests
<Tailwind>:md:shadow-md md:inset-shadow-smwritergb(0,0,0,0.1)and no whitespacergb()in the<style>.sanitizeNonInlinableRules: after a shadow, a ring and a mask (whose fallback is another variable) go through it, novar(--tw-*, …)is left, and the ring'svar(--tw-ring-offset-width), which has no fallback, stays.canary.pnpm lintandpnpm typecheckpass. The package tests pass (react-email419,render110,ui113,editor573,web36) except tworeact-emailCLI specs that fail oncanaryon Windows too (export-esbuild-plugins,isUnderDirectory).AI disclosure: written with Claude's help. I reviewed the change and the tests, and checked the fixed build in Gmail web.
Checklist
Summary by cubic
Fixes Gmail dropping
<style>rules that use shadows with variants likehover:shadow-mdormd:shadow-lg.sanitizeNonInlinableRulesnow replacesvar(--tw-*, <fallback>)in<style>rules with the fallback, matching how inline styles already resolve fallbacks. Variant shadows now emitrgb(0,0,0,0.1)instead ofvar(--tw-shadow-color, rgb(0 0 0 / 0.1)).--tw-*variables are substituted; user variables andvar()calls without a fallback are untouched.<style>, and variant shadows still don't render in clients that keep the<style>.Written for commit bf13b20. Summary will update on new commits.