You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2021/03/18 16:57:09 UTC

[GitHub] [cordova-android] MichaelPote commented on issue #897: Dark Mode Android

MichaelPote commented on issue #897:
URL: https://github.com/apache/cordova-android/issues/897#issuecomment-802109505


   I've found something which fixed it for me!
   
   From https://developer.android.com/guide/webapps/dark-theme
   
   "WebView can't differentiate based solely on the presence of the media query, so it needs a color-scheme meta tag with dark value as indication that a web page has its own dark theme. To prevent double-darkening (that is, applying color inversion on top of media query customization) WebView evaluates @media (prefers-color-scheme: dark) to false in this mode."
   
   So I added `<meta name="color-scheme" content="dark">` to my html and presto - it now detects my prefers-color-scheme: dark query.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org