Please let WebView support CSS media query ‘prefers-color-scheme' #22256
Replies: 3 comments
-
According to this post: https://stackoverflow.com/questions/57449900/letting-webview-on-android-work-with-prefers-color-scheme-dark It sounds like on Android as long as you target the right API version it should all just work. Can you confirm whether you've tried that? Or what did you try and what doesn't work? |
Beta Was this translation helpful? Give feedback.
-
Hi @Amir000001. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
Beta Was this translation helpful? Give feedback.
-
I tried (
But this does not work when the OS theme changes and the webview is open, you need to refresh the page |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
For better user experience with dark mode on web sites, Please let WebView support CSS media query prefers-color-scheme.
Public API Changes
Android & iOS both platforms have problems but different.
Android's WebView can not detect media query prefers-color-scheme at all.
iOS's WebView is correctly following OS's appearance, but there is white background flashed before page loaded under dark appearance.
Let WebView with CSS media query prefers-color-scheme support, so the pages implemented would switch theme by OS automatically.
Intended Use-Case
MS offical doc site has implemented prefers-color-scheme
So everyone can test on https://docs.microsoft.com/en-us/xamarin/
Beta Was this translation helpful? Give feedback.
All reactions