CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very usefull when you're sending emails.
I'm working on a problem with certain versions of Outlook email client, and came to a solution where I need to apply styles to every email client, except Microsoft Outlook.
But the problem is that it's being inlined, as it's a valid non-commented <style> attribute.
I've been thinking that having a way to disable inlining of styles from a specific style attribute could solve this. For example, the regular expression in Processor::getCssFromStyleTags() could ignore style tags that have do-not-inline attribute:
Hi!
I'm working on a problem with certain versions of Outlook email client, and came to a solution where I need to apply styles to every email client, except Microsoft Outlook.
There's a conditional comment that can do that:
But the problem is that it's being inlined, as it's a valid non-commented
<style>
attribute.I've been thinking that having a way to disable inlining of styles from a specific style attribute could solve this. For example, the regular expression in
Processor::getCssFromStyleTags()
could ignore style tags that havedo-not-inline
attribute:https://github.com/tijsverkoyen/CssToInlineStyles/blob/master/src/Css/Processor.php#L38-L39
I can file a PR if you agree it's a good addition.
Anyway, thank you for your great work! This package is helping us a lot with rendering emails :+1: