foundation-emails icon indicating copy to clipboard operation
foundation-emails copied to clipboard

Feature Request - Dark Mode

Open burgiuk opened this issue 5 years ago • 8 comments

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.

burgiuk avatar Jan 29 '20 15:01 burgiuk

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?

DanielRuf avatar Jan 29 '20 16:01 DanielRuf

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.

DanielRuf avatar Jan 29 '20 16:01 DanielRuf

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.

DanielRuf avatar Jan 29 '20 16:01 DanielRuf

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.

burgiuk avatar Jan 30 '20 15:01 burgiuk

I think we can collect things and resources regarding this in this issue. That would be great.

DanielRuf avatar Jan 30 '20 15:01 DanielRuf

Is there some news about implementing the dark mode support?

goonerDp avatar Oct 27 '22 09:10 goonerDp

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.

viking1304 avatar Nov 22 '22 18:11 viking1304

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.

goonerDp avatar Nov 29 '22 11:11 goonerDp