react-email
react-email copied to clipboard
Add global styles to emails
Adding global style as a feature could be nice.
I was able to make it work by creating a new file /emails/styles.tsx
// styles.tsx
export const main = {
backgroundColor: '#000',
};
// email.tsx
import { main } from './styles'
Issue with this method
styles.tsx shows up in preview. Workaround is to name the file components.tsx which is filtered from the list
I wasn't able to get it to work if I had the file in a subfolder. Could be nice to have a /styles/ folder and ability to have multiple template styles there.
Yup! Let's add it.