Tailwind stacked media variants leave nested CSS in rendered emails

オープン
#3,874 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@lakshya-dhariwal がすでに取り組んでいます。

2026年11月8日 から。

  • #3875 @lakshya-dhariwal による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
node.js, react, tailwindcss, typescript
領域
frontend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
TypeScript
スター
19.9k
フォーク
1.1k
平均マージ
1日 15時間
マージ済み PR(30日)
49

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

resend/react-email のほかの issue

resend/react-email の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。