I am working on transactional email like the responsive html email template. If I have the CSS in the file public/css/email.css
, what is the most idiomatic way to include the contents of the email.css
in the header of html file? Note that I do not just want a link, but would like to include the contents of the email.css
in the HTML in the section. Do I simply slurp and insert the contents of email.css
or is there a better way.
Asked
Active
Viewed 193 times
0

user1135541
- 1,781
- 3
- 19
- 41
-
If you are slurpring, make sure to use a resource and not a file. Once you package your application into an uberjar the css is no longer readable like a regular file from the filesystem. – cfrick May 29 '21 at 12:43
-
Does this answer your question? [Inline styling with hiccup](https://stackoverflow.com/questions/25515243/inline-styling-with-hiccup) – Steffan Westcott May 29 '21 at 12:54
-
@SteffanWestcott, the inline styles are styles added to each html element, I am asking about inserting *not inline* but a style section to the html header. – user1135541 May 29 '21 at 14:33
-
The answer to the linked question illustrates adding styling information to the head element using hiccup syntax. – Steffan Westcott May 29 '21 at 18:25
-
@SteffanWestcott, OK, thank you, so the recommendation is to take the CSS file, translate it to hiccup style, then add it into the like that answer. I was hoping there would be a way to just include the CSS as is and use the styles in the html. – user1135541 May 29 '21 at 19:33