This CSS trick successfully switches between Dark and Light environments inside Glide โ tested directly in the DOM (not in the custom CSS field). Iโm not sharing the full code here since itโs quite long, but the concept is fully replicable.
How it works:
-
Set your appโs base appearance to either Dark or Light under Settings โ Appearance.
-
Create a flag column in your User Profile table that stores which button (Dark/Light) is currently active.
-
Add an empty Rich Text component (for example with class name
"dark-mode"
) that acts as a flag element, and set its visibility to depend on the flag value โ so it only appears in the DOM when the flag is active. -
Use a Glide variable to override one environment style (Dark or Light, depending on your default).
-
This CSS method doesnโt automatically affect AI components, but they might be adjusted to follow the same flag if configured accordingly.
This implementation is built entirely with Glide logic and advanced CSS targeting.
Disclaimer:
-
This method depends on Glideโs current DOM structure, which may change in future updates.
-
If your CSS includes many
!important
rules elsewhere, this code might not work as intended.
If youโre interested in using this system for your own Glide app, feel free to reach out.