Skip to content

!important being removed from non-inlined CSS #410

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
TopCoder02 opened this issue Jun 14, 2024 · 1 comment
Open

!important being removed from non-inlined CSS #410

TopCoder02 opened this issue Jun 14, 2024 · 1 comment

Comments

@TopCoder02
Copy link

When using premailer and if the class matches a style, it removes !important on styles, that have nothing to do with the class being inlined.

I see issues in the past logged here where it says Outlook Ignores !important, that doesn't really seem the be the case anymore and many email clients support it now without issue. I also feel that in the style tag, itself, if the color was red !important it should be an optional if you want to transfer the !important it. Most use cases I think the answer will be "no", but I can see edge cases where you would want to keep it.

This:

 <style> 
 .test {
  color:red;
  }
  </style>
<body>
 <p class="test" style="font-weight: bold !important;">test</p>
</body>

Becomes this notice the !important was removed from the font-weight:

<body>
 <p class="test" style="color:red; font-weight: bold;">test</p>
</body>
@martinnormark
Copy link
Contributor

Isn't this fine, since all styles are inlined? There should be no style block targeting the p tag?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants