jonkemp / inline-css

Inline css into an html file.
MIT License
429 stars 85 forks source link

Do not combine css properties #45

Open Kaless1n opened 8 years ago

Kaless1n commented 8 years ago

To stop underlining links in Outlook web app you have to set the following rule:

a {
    text-decoration: none !important;
    text-decoration: none;
    }

What i get after running inline-css plugin is: <a style=" text-decoration: none;"> I think this plugin should not be so smart and should inline my css as it is leaving both rules in same order.

It would be great if you will add such option to API or point me at module which is responsible for combining css properties.

podorozhny commented 8 years ago

+1

daveycakes commented 7 years ago

Why not just fix it manually after inline-css has run? eg: html = html.replace('text-decoration: none;','text-decoration: none;text-decoration: none !important;')

This seems wiser than making a module work less well for the sake of an application with it's own weird rules. I can sympathise, Outlook is horrible, but that's no reason to break good css parsing.

alenvuletic commented 7 years ago

+1

I have the same problem when implementing fallback for background-image:

background: #ffffff;
background: url();

Thanks!

tommedema commented 6 years ago

@daveycakes I would recommend the issuer of this issue to create a separate package doing such post processing for emails only. Keep in mind that inlining CSS is not only for email purposes, so I totally agree that such email client hacks should not be considered in this package.