Is there a clever way to let light/dark mode of the dashboard follow browser or Windows? The dashboard does not retain the setting but always defaults to light, so I’ve added:
Set-UDTheme -Name ‘Dark+’ -Variant ‘Dark’
Which works fine, except now I have some users that actually want light mode.
So either the detection or a way to preserve the users’ selection is needed.
i would recommend taking a look at Invoke-UDJavascript, specifically for the window.matchMedia method. you can invoke a callback at that point written in powershell
Yeah, I’ve got the window.matchMedia down and it shows the correct value, but getting that value back to PowerShell to set the theme is apparently beyond me…
Would it perchance work to put the Code in an New-UDDynamic, that loads on page load, and executes Set-UDTheme -Name ‘Dark+’ -Variant ‘Dark’ based on the values from window.matchMedia?
Can you share the code for getting the values? I’d like to make use of it as well