Hello Anvil user.
I have an app that has a user side and an admin side. I am using the Material Design Theme. I want to help highlight this by dynamically changing the app-bar’s (top horizontal bar) colour from primary to secondary depending on whether the user is in Admin mode or User mode.
I have dug into the CSS and see the relevant portion to change. I could create a new entry in the CSS theme, and use some javascript to make the change. But, that seems to defeat the purpose of using Anvil.
Any good ideas of how to do this without resorting to CSS+JS?
It seems the natural thing would app-bar to be another object with a colour attribute. But, I don’t think it currently exists as such.
If that were the case, when I navigate to the admin portion, I could add something like:
self.app-bar.colour = 'secondary'
And, when navigating back to the user portion, I could add something like:
self.app-bar.colour = 'primary'
Thank you in advance for any help.
Cheers. A.