react-email icon indicating copy to clipboard operation
react-email copied to clipboard

CSS variables defined in the template are substituted with `undefined` when using Tailwind

Open wladpaiva opened this issue 1 year ago • 5 comments

Describe the Bug

Right now, if you want to use the same Shadcn styles in the react-email you have to duplicate the tailwind config file and manually replace the css variables with the actual values. Apparently react-email strip out <style> tags before transforming classnames to styles.

Which package is affected (leave empty if unsure)

@react-email/tailwind, react-email

Link to the code that reproduces this issue

https://github.com/wladpaiva/react-email-shadcn

To Reproduce

  1. run bun dev
  2. open template and inspect <Text> elements

Expected Behavior

Screenshot 2024-05-08 at 12 34 39

Both <p>s should have background set but only the one using the css variable is set to undefined

What's your node version? (if relevant)

No response

wladpaiva avatar May 08 '24 15:05 wladpaiva