The way OH sets dark mode is not working for me. I need to code it into the page.
Spend the day researching it but best I could come up with is enabling dark mode on oh-grid-col. And only that element.
Assuming that this is not implemented yet fully (not a bug…) I want to add the “dark” class near the body tag of the html page.
After “theme-filled” I need the string " dark". Sounds simple enough. Now, does anyone know where the template is that this page file is generated from ?
Alternatively, when would it be possible to use ‘themeDark: true’ on other elements or the whole page ?
default is light theme. This line does switch to dark on these conditions:
It checks if there is a value stored in the local storage with the key 'openhab.ui:theme.dark'. If there is, it uses that value.
If there isn’t a value in local storage, it checks if window.OHApp is defined and if window.OHApp.preferDarkMode is a truthy function. If so, it calls window.OHApp.preferDarkMode().toString() and uses that value.
If neither of the above conditions is true, it checks if this.$f7.darkTheme is truthy. If it is, it sets 'dark'; otherwise, it sets 'light'.
is probably set when I use the official way of switching to dark mode through the ‘about’ menu - not persistent on my device.
must be a browser property that I cannot find in my browser (“fully” on a (android) fire tablet)
this.$f7.darkTheme . No idea where this is set. A url parameter doesn’t do the trick by any chance ?
I still hesitate to fiddle with the html template…