-
-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
email generation - inline css possible ? #92
Comments
You can use standard It's completely valid to do something like:
And you'll get the CSS class and raw script content included in the output. If you're interested in what that looks like, there's a "raw" element parser which doesn't try to parse the content of script and style elements at https://github.com/a-h/templ/blob/main/parser/v2/raw.go The behaviour is covered in this unit test: https://github.com/a-h/templ/tree/main/generator/test-raw-elements Thanks for trying out templ, and taking the time to ask questions and raise issues! |
How do we go about using tailwindcss in the email templates and generate the inline style block? |
Sorry I did not get time to try out your suggestion @a-h |
i wonder if templ can handle generation of emails ?
I know html are a huge pita because of CSS and also email clients being a little different. Outlook etc.
But it has a first class html parser etc. I just don't know how well it can handle css inline as i think this is what html emails demand.
Wow the docs are very well done and concise.
Looking a the example docs at https://templ.guide/syntax-and-usage/css-style-management#css-expressions
Looks like it would just require a post processing step to do the inlining as all the mapping is there. namly: className_f179
The text was updated successfully, but these errors were encountered: