Universal UD V3 Dark/Light Mode Toggle

Hi All,
I’ve had a few hurdles attempting to migrate to 2.9.1 and for what its worth, at least with one of my dashboards with less on it, i figured i’d just go for a rebuild from scratch on v3 anyway.

Sorry if I’ve missed something obvious here, I’ve just setup a new v3.0.2 dashboard, but cant seem to get the night mode button working in the app bar, it doesnt seem to do anything, anyone else had any luck?
I’ve tried specifying with and without a $theme, when I do it with, I’m only setting values for dark,light,main in primary and secondary inside palette (as per the material-ui docs).

I also have tried to add my own app bar, but cant see any parameters or switches to hide the night mode toggle either.

Seems I get the same error with or without specifying -theme on new-uddashboard:

Any ideas?

Good timing!

I just released PSU 1.3.2 and UDv3.0.3. There was a problem with the dark\light theme. There was also a problem where the background wouldn’t change based on the theme. These have been fixed and I’ve started to better document the use of themes here: https://docs.ironmansoftware.com/dashboard/themes

That said, there are SOOO many options here I would imagine that you may run into issues. Please let me know if anything you try to customize doesn’t work. After playing with this a bit, I can say that I’m surprised by what changes when I adjust various colors.

For example, to change the default button color, I had to set grey 300. Weird.

https://docs.ironmansoftware.com/dashboard/themes#changing-default-button-colors

Another thing I’ll be looking at doing is exposing some better per-component controls over style and theme options. There isn’t a good, consistent way to just change the color of a single component.

I also need to expose that toggle button as a control you can place so if you override the app bar you can choose to show it.

2 Likes

Awesome, thanks :slight_smile: I’ll get on it asap!
Luckily colours and styling isn’t much of an issue for me, it’s just the main basics to follow the branding (and match with the old dashboard) with a logo at the top and I’m good! But i’ll have a play around and see where I get with it, seems like theres a lot of customisation with material-ui.

Also, pinging @dcherry88 as I think you were interested in more info about this as well.

Is it published now, I couldnt find it or am I being too trigger happy? :sweat_smile:

Purged the Cloudflare cache. Can you try here again? https://ironmansoftware.com/downloads/

Thats done the trick. Thanks. Downloading!

I can confirm it’s fixed the dark/light toggle! Thanks again :slight_smile:
I did notice though when I was running 1.3.1 and now that I’ve upgraded to universal 1.3.2 the UI looks like its gone back to the older style, not sure if that’s because I was running the nightly builds?

1 Like

Nightly builds are 1.4 builds. That’s why it looks different. If you upgrade from 1.3.2 to the nightly tomorrow, you should have this fix in it.

2 Likes