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

Apple Mail requires the supported-color-scheme meta or CSS property for dark mode #104

Open
hteumeuleu opened this issue Nov 26, 2021 · 1 comment
Labels
Apple Mail macOS and iOS

Comments

@hteumeuleu
Copy link
Owner

hteumeuleu commented Nov 26, 2021

All versions of Apple Mail (on macOS or iOS) require either the <meta name="supported-color-scheme" value="light dark"> tag or color-scheme: light dark; CSS property for dark mode to work. This is weird and opposite to the way dark mode works on the web where these meta/property are totally optional and only serve to let the browser make default changes (for form controls for example).

On top of that, Apple Mail requirements for these has evolved over the years. From what I can test, in Apple Mail 12 (macOS Mojave), Apple Mail requires the meta notation (and doesn't support the CSS notation):

<meta name="supported-color-schemes" value="light dark">

From Apple Mail 13 (macOS Catalina) and above, Apple Mail requires the CSS notation (and no longer supports the meta notation):

:root {
    color-scheme: light dark;
}

Also worth mentioning that before Apple Mail 12, during macOS Mojave beta, Apple supported the old syntax (with color-scheme instead of prefers-color-scheme). There was also a syntax of @media (prefers-dark-interface) but I don't believe it was ever supported.

MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme

@hteumeuleu hteumeuleu added the Apple Mail macOS and iOS label Nov 26, 2021
@hteumeuleu hteumeuleu changed the title Apple Mail requires the supported-color-schemes meta or CSS property for dark mode Apple Mail requires the supported-color-scheme meta or CSS property for dark mode Nov 26, 2021
@o-t-w
Copy link

o-t-w commented Sep 19, 2023

I just checked this on Apple Mail in the new iOS 17 and macOS Sonoma 14. It is sadly still an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Apple Mail macOS and iOS
Projects
None yet
Development

No branches or pull requests

2 participants