CssToInlineStyles
CssToInlineStyles copied to clipboard
Keeping double properties
In my case of use I have to set e.g. text-decoration
property twice to make it correct in all target supported mail clients. It means my links have text-decoration: none; text-decoration: none !important;
.
Inliner gets logically only last value, it means link in inlineCssOnElement
function has $inlineProperties['text-decoration'] = "none !important"
.
It isn't problem to edit function to keep original styles and only add not included:
...
foreach (/*array_merge(*/$cssProperties/*, $inlineProperties)*/ as $property) {
$rules[] = $property->toString();
}
$element->setAttribute('style', $element->getAttribute('style').implode(' ', $rules));
...
but which way is optimal for keeping both properties from style
tag? Generally I need to add important or non-important version of property if miss in inline.
Has anyone idea?
Thanks in advance!
Hi @PreVaDu. Any updates on this? Have you found a solution/alternative?