3

I'm building a scala template which will be used to generate HTML for emails sent from a website.

I'd like it to reuse the same LESS stylesheet I'm using on my website. For this, I'll need the compiled CSS to be available so I can inline it in the output of the scala template (within <style> tags, as opposed to CSS in a separate file/URL).

What's the most elegant way of doing this in the Play Framework, please?

Chris Beach
  • 4,302
  • 2
  • 31
  • 50

1 Answers1

0

i assume you can just include it using the link tag..and then use the reverse router like this

<link rel="stylesheet" href="@routes.Assets.at("stylesheets/main.css")">

it will automatically compile the less file PS-include this in the html tag

mshukla
  • 807
  • 5
  • 8
  • Thanks, but I'm interested in inlining the CSS, not linking to it as a file or URL - this is for emails, and there are specific requirements I'm looking for to ensure the email is visible in all mail clients. – Chris Beach Jun 13 '14 at 11:07
  • okay..a LESS source file at app/assets/stylesheets/main.less will be available as a standard resource at public/stylesheets/main.css so you have the compiled source available but i don't know where to go from here :O – mshukla Jun 13 '14 at 16:27