Tailwind stacked media variants leave nested CSS in rendered emails

Aperta
#3,874 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@lakshya-dhariwal ci sta già lavorando.

Dal 8/11/2026.

  • #3875 di @lakshya-dhariwal — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
node.js, react, tailwindcss, typescript
Ambito
frontend

Direzione di ricerca

Start by reading the compatibility conversion function at canary commit 674d8ec2804b86be5d99156383fb1810179847bf and reproduce the issue with [email protected] using the provided sm:dark:bg-black example. The issue does not name a file or test path, so locate the conversion’s tests and compare the generated CSS with the expected flattened media query. The issue is linked to open pull request #3875.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

With [email protected], Tailwind CSS 4.3.5 and Node 24.22.1, combining variants such as sm:dark:bg-black leaves an @media inside a CSS style rule.

import { render, Tailwind, Head, Html, Body, Text } from 'react-email';

const html = await render(
  <Tailwind>
    <Html>
      <Head />
      <Body>
        <Text className="sm:dark:bg-black">Example</Text>
      </Body>
    </Html>
  </Tailwind>
);

Actual generated CSS:

@media (min-width:40rem) {
  .sm_dark_bg-black {
    @media (prefers-color-scheme:dark) {
      background-color:rgb(0,0,0)!important;
    }
  }
}

Expected: flatten the media conditions without leaving CSS nesting inside a style rule, consistent with the compatibility conversion’s stated purpose.

@media (min-width:40rem) and (prefers-color-scheme:dark) {
  .sm_dark_bg-black {
    background-color:rgb(0,0,0)!important;
  }
}

Single variants work correctly. The same nesting reproduces when directly testing the conversion function from canary commit 674d8ec2804b86be5d99156383fb1810179847bf with [email protected]. The full canary renderer and actual Gmail/Outlook rendering have not been tested.

Lingua principale
TypeScript
Stelle
19.9k
Fork
1.1k
Merge medio
1g 15h
PR unite (30g)
49

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di resend/react-email

Tutte le issue di resend/react-email

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.