Feature Request - Dark Mode
With the increased usage of dark mode in email clients is Foundation for Emails planning to include dark mode specific media queries?
These are discussed in this article.
For our customers it is is at the tipping point of where most of the clients used can handle dark mode.
Depends on the CSS support in email clients. These are not webbrowsers.
We do not plan to include this feature so far but you can already write the needed code with fallbacks. And this will not work with inlined styles.
I see not much sense to apply this to emails.
Does anyone already do this?
I've briefly checked the article. It seems that many clients still have a few issues
So far we mostly generate the html and the scss can be extended.
We would welcome a PR for this but the needed effort compared to the quirks in the clients would be too much at the moment. Because if this should be in the core we have to adjust many things and probably use hsl, an additional color scheme or create some color conversion function.
Also in general this would mean much more generated CSS which could cause that Gmail cuts the email after a few KB of data.
I think there are many side effects.
I agree it is probably still early days for this. For now I think we will just manually test for dark mode compatibility and make tweaks where necessary.
I think we can collect things and resources regarding this in this issue. That would be great.
Is there some news about implementing the dark mode support?
Is there some news about implementing the dark mode support?
The dark mode is very inconsistent among different mail clients, so it's almost impossible to create CSS that will work properly everywhere automatically.
Some clients fully support prefers-color-scheme media queries, some only have partial support for it, and some don't have any support.
[data-ogsc] is not of big help and it is also completely discarded on foundation compile.
There are a lot of tricks (or better say hacks) on how to get the colors you want in dark mode, but none of those are fully functional in all clients. To make it worse, some of those hacks that work perfectly in one mail client completely break the other.
The mail clients from Hell are Gmail on iOS and Windows Mail. Everything else can be made to look almost the same, but those two are... I will stop before I start to use inappropriate language.
Is there some news about implementing the dark mode support?
The dark mode is very inconsistent among different mail clients, so it's almost impossible to create CSS that will work properly everywhere automatically.
Some clients fully support prefers-color-scheme media queries, some only have partial support for it, and some don't have any support.
[data-ogsc] is not of big help and it is also completely discarded on foundation compile.
There are a lot of tricks (or better say hacks) on how to get the colors you want in dark mode, but none of those are fully functional in all clients. To make it worse, some of those hacks that work perfectly in one mail client completely break the other.
The mail clients from Hell are Gmail on iOS and Windows Mail. Everything else can be made to look almost the same, but those two are... I will stop before I start to use inappropriate language.
Ok. Thanks for the info.