feat: inline duplicate properties#575
Merged
Merged
Conversation
Collaborator
Author
|
@jrit not sure if you want to review? |
Collaborator
|
no qualms from me, I defer to your decisions @cossssmin |
Collaborator
Author
|
Thanks man, I have one more idea for a feature and I also want to look into #387, then we can do a feature release. And after that I can look into the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a new option,
inlineDuplicateProperties, which allows the user to choose whether Juice should inline the same property multiple times on the same element, instead of only inlining the winning/highest specificity selector.This option is
falseby default, you need to opt-in to the functionality.The use-case is particularly for HTML emails, where progressive enhancement is sometimes required because not all email clients support the same level of CSS features. For example, given this Tailwind CSS example:
... with
inlineDuplicateProperties: truewe can get this output:... which will show a solid black background color in clients such as Outlook on Windows, which do not support
rgba.Closes #380