Skip to content

Tailwind color-scheme media classes are only added on body tag #1871

Open
@NickTiut

Description

@NickTiut

Describe the Bug

If you are using the latest version of @react-email/components: 0.0.32 the Tailwind media classes are only added on the body, all other generated html tags have a class of dark:text-green-500 and are not using the dark_text-green-500 generated in the <style> tag.
I believe there was an issue introduced in @react-email/tailwind 1.0.1 maybe?

Which package is affected (leave empty if unsure)

@react-email/tailwind

Link to the code that reproduces this issue

https://github.com/NickTiut/react-email-bug

To Reproduce

Run npm run dev on the example provided and open in browser dark mode. The color of the text should be green, instead it it red.

Image
Image

Expected Behavior

The color of the text should be green, instead it it red.
If you switch the version in package.json to "@react-email/components": "0.0.23" it behaves as expected.

Image
Image

What's your node version? (if relevant)

20.4.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions