Greetings fellow Gliders. A similar question was asked back in 2019 from another developer, but wondering if there has been any new update on this.
Is there a simple way to “toggle” a Glide App Appearance settings for a “Light” or “DarK” Environment AND/OR the Background setting for “Highlight” or “Neutral” using the result of and IF THEN ELSE or a SWITCH setting?
We wish to be able to flip back and forth between Light and Dark app Environment from the app on the fly without needing to alter this setting in the Glide back-end. Not users performing this (as in matching a user device theme settings) but our development team performing this function. Thoughts?
You can do this with a CSS-based approach, using an IF THEN ELSE or SWITCH in Glide to control the theme.
I discussed the concept of switching Glide’s Light and Dark environments dynamically here:
The post documents the concept and approach rather than the full CSS code. The original implementation was quite extensive because it required overriding multiple parts of Glide’s UI.
For your particular use case, I would actually consider using dynamic theme colors rather than trying to reproduce the entire Light/Dark environment. It is much simpler to manage and can still be driven by a Glide condition or SWITCH.
Here is another example where I used :has() to respond to app state and dynamically change theme colors:
So the general pattern is:
Glide condition / SWITCH → expose the state in the DOM → CSS responds to that state → theme changes dynamically.
This can be adapted for a development toggle controlled from within the app, without changing the setting in the Glide builder.