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

Tailwind Support

Open mmailaender opened this issue 1 year ago • 2 comments

If I try to design the Email with Tailwind, it's not working. Do I have to do any additional preparation to get it working?

<Button style={button} class='bg-red-700 px-12 py-12' href="https://github.com/carstenlebek/svelte-email">
	View on GitHub
</Button>

mmailaender avatar Jun 22 '23 13:06 mmailaender

You need to inline your variables in the style prop. I'm guessing it would be a pretty big lift to add Tailwind support, because you would need to find those global styles and apply them directly to the rendered component in the email.

Brandon-Ritchie avatar Aug 31 '23 15:08 Brandon-Ritchie

I would love to see this and even could help out to make it happen.

I think it's pretty easy looking at react-emails implementation. They use a package called tw-to-css to render tailwindcss to styles. Shouldn't it be as easy as wrapping the root and compile those styles in?

I use tailwind in all my projects and it always feels like a pain to write plain css.

juliuslipp avatar Sep 27 '23 11:09 juliuslipp