`prefers-color-scheme` doesn't work in Web Dialog

81 views
Skip to first unread message

Ricardo Fernández Serrata

unread,
Mar 4, 2022, 11:22:35 PM3/4/22
to Automate
I made a flow (the file included with this post) that (on my Android O 8.1 device) says that the feature is supported, but another part of the code makes use of it and doesn't detect dark theme being set (it always fallback to light theme by default). Sources: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme , https://web.dev/prefers-color-scheme/#supporting-dark-mode

However, I have another flow that makes use of `color-scheme` and `theme-color` and works as expected: https://llamalab.com/automate/community/flows/35757

Web theme test.flo

Ricardo Fernández Serrata

unread,
Mar 5, 2022, 1:08:02 AM3/5/22
to Automate
I set my system theme to dark mode, and then light mode and back again, but `prefers-color-scheme` still seems to return "light". I have the latest version of Chrome, which is my system's WebView

Henrik "The Developer" Lindqvist

unread,
Mar 5, 2022, 7:55:04 AM3/5/22
to Automate
The documentation is a bit vague, but it may only be supported on Android 10+ device, see: https://developer.android.com/guide/webapps/dark-theme

Ricardo Fernández Serrata

unread,
Mar 5, 2022, 11:26:35 AM3/5/22
to Automate
I think that explains it. Thanks for the info. It seems that Google only wanted to fully support dark theme since A10. I'm a bit disappointed of Google, but that's something kinda expected. I guess I have another reason to switch  to a newer device
Reply all
Reply to author
Forward
0 new messages