Tailwind stacked media variants leave nested CSS in rendered emails

Abierto
#3,874 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@lakshya-dhariwal ya está trabajando en esto.

Desde el 8/11/2026.

  • #3875 de @lakshya-dhariwal — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
node.js, react, tailwindcss, typescript
Área
frontend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
TypeScript
Estrellas
19.9k
Forks
1.1k
Merge medio
1 d 15 h
PR fusionados (30 d)
49

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de resend/react-email

Todos los issues de resend/react-email

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.