I would like a library to create inlined CSS+HTML from .html and .css files or from an HTML file with tags in the head. I would prefer a PHP library if possible.
By inlined CSS I mean something like
<span style="font: bla bla bla">Hi There!</span>
versus
<style>
.greeting { font: bla bla bla; }
</style>
I often need to put HTML into emails and this would simplify the process greatly.
If anyone is interested, my current solution (for stuff that isn't restyled often) is to use the Smarty templating engine to create the document, and to assign the style="" part to a variable inside the template.
Then I can use that variable in each tag (like <td {$td_style}> (FYI - {$variable} is how smarty variables are inserted into a template) and have it generate the appropriate email-friendly HTML.
However I want something that is more general, and for which I can just feed it some HTML and CSS rather than have to convert all of it to a smarty template.
Does anyone know if a library like this exists?
color:#000000; font-size:12px; font-family: Arial, Georgia, Comic Sans;or some other nonsensical font stack, and images withsrcthat points to their hard drive.