shellscape / jsx-email

Build emails with a delightful DX
https://jsx.email
MIT License
986 stars 33 forks source link

Tailwind Dark mode not working as expected #162

Closed john-griffin closed 7 months ago

john-griffin commented 8 months ago

Expected Behavior

Expect the email background to be black due to the dark:bg-black class on the body when previewing in dark mode browser.

Actual Behavior

Takes the light mode background style instead

Additional Information

Worked on react-email. Aware this is not going to work in all email clients.

john-griffin commented 8 months ago

Gist of HTML output from react-email that works as expected https://gist.github.com/john-griffin/fee98877edf1ef039e324dcd2760373f

shellscape commented 8 months ago

Alright we tracked this down to a difference between unocss and tailwind outlined here: https://unocss.dev/presets/mini#dark

Going to work on a potential builtin solution so users don't have to know they have to prefix darkmode variants with a @

For anyone running across this issue in the meantime, the solution is to use @dark:... instead of dark:...

shellscape commented 7 months ago

Fixed this in https://github.com/shellscape/jsx-email/pull/167