Skip to content
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

Prefer !important rules over non-!important rules in the same ruleset #175

Merged
merged 1 commit into from
Mar 9, 2025

Conversation

mogest
Copy link
Contributor

@mogest mogest commented Mar 8, 2025

Previously, the css rule "color: black !important; color: red;" would be collapsed to "color: red;" as the processor did not take whether the !important flag was set inside the same rule.

This commit makes the Declaration Value initializer take notice of the !important flag and correctly handle it.

Pre-Merge Checklist

  • CHANGELOG.md updated with short summary

Previously, the css rule "color: black !important; color: red;" would be
collapsed to "color: red;" as the processor did not take whether the
!important flag was set inside the same rule.

This commit makes the Declaration Value initializer take notice of the
!important flag and correctly handle it.
Copy link
Contributor

@grosser grosser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes way too much sense and even a test, thx!

@grosser grosser merged commit 9471b2a into premailer:master Mar 9, 2025
6 checks passed
@grosser
Copy link
Contributor

grosser commented Mar 9, 2025

1.21.1

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

Successfully merging this pull request may close these issues.

2 participants