Search code examples
asp.net-mvccombres

How do I use Combres to embed the actual minified resource instead of a link?


I'm writing an MVC view which will be sent as an HTML email. Since many mail clients don't render external CSS stylesheets, I need to include them inline. Since I'm already using Combres to combine and minify my stylesheets on the main site, I want to use it to insert the styles into my email view.

I could use Html.CombresLink("siteCss") to render a <link> to the minified stylesheet, but how do I render the actual CSS inline instead?


Solution

  • Currently, Combres doesn't support that. Given the fact that combined sets are usually large, I can't really see the reason why you would inline them. Externalizing them will use the browser cache efficiently while not doing so, you have to load the content every single time the page is loaded.