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

Dark-Mode in emailing (with juice) #469

Open
kornelion opened this issue Jul 25, 2023 · 2 comments
Open

Dark-Mode in emailing (with juice) #469

kornelion opened this issue Jul 25, 2023 · 2 comments

Comments

@kornelion
Copy link

Hi there,

I'm looking in a way to preserve the way dark-mode css code with juice for emailing generation.

In emailing, we have to cope with different email platforms, each handling the dark-mode differently.

While the @media (prefers-color-scheme) is working fine, we need to use other element to make it work with Microsoft Outlook for example :

[data-ogsc] .text{
 color: #ffffff!important;
}

And

[data-ogsb] .text{
 color: #ffffff!important;
}

But those declarations are stripped of when juice does its thing.

Any indication or update that can be made to avoid this ?
Thanks !

@cossssmin
Copy link
Collaborator

Juice would need a 'safelist' option to define selectors that shouldn't be inlined. There is excludedProperties, but that is for things like 'padding' or 'display'.

Would be a great feature to add 👍

@jrit
Copy link
Collaborator

jrit commented Dec 6, 2023

if you have control of what is css from a link and what is in a style tag, you can put the stuff you want to preserve in style and set removeStyleTags = false. or you can set up some postprocessing stuff to add these styles into your final html. dealing with rewrites that are not actually inlining css, like this is, tend to be not too bad

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

3 participants