Searching through topics on Dark Mode, I've seen a number of posts suggesting the use of invert, which limits the control a user has over color selection and impacts the entire browser. I've also found extensions being suggested, which is absolutely unnecessary.
Implementing dark mode is actually quite simple and only takes a few minutes.
Create a variable for storing whether or not dark mode is enabled (Example: darkModeValue). Set this value to either true or false. You can also set it to an integer or string for some more complexity, like letting the user choose different color schemes.
Create another variable for setting a color value (Example: cssBackgroundColor) and assign a ternary condition with a different color value for light and dark modes. Do this for as many element colors as you'd like.
Example: {{darkModeValue.value==1? '#00000' : '#ffffff' }}
In your topmost Component Tree container (or any component of your choice), go to the inspector, scroll down and add a new custom style setting. Set the background value to a variable.
Example: {{ cssBackgroundColor.value}}
Create some kind of an element, like a switch, to update the first variable you created. In my example, hitting this toggle will set darkModeValue to either 0 or 1.
This is great. Wish there was a way to reference variables in css settings to handle this on the top. Going to try this with multi-page apps to see how it handles transitions. Thanks for the share.
I had ChatGPT generate me different themes (JSON) based on this list of attributes that I'm collecting. It did okay, but I think you can see the potential here.
The annoying part is that any time you add a new component, you need to add the variables back in, which is quite tedious. I haven't tried modules yet, but maybe I could create a module for each component, or manage an app which I can copy & paste the components over to the app I'm working on. Although, if Retool could expose all of the possible styles at the branding/theming level, that would be cool too!
You can now create and manage themes from your organization's Themes settings, or create custom themes that apply to individual apps. Organization-level themes are only available on Business and Enterprise plans. Custom themes are available on all plans.