I have tried to use conditional formatting for implementing a dark mode.
I found a few downsides:
- We cannot use Styles in conditions. We need to specify the dark mode colors for every single element.
- The user sees the default light color for a second or so, before it changes to dark - every time a page is accessed or refreshed. This creates an annoying flickering effect.
Hence I’m thinking of doing the following instead. But because it’s quite an extensive change, I need opinions on whether this is a good idea or not, before I proceed. e.g. every element now needs to access User data type before it can render - any potential issues with that? Any feedback or comments are appreciated!
- I create a new option set Color Mode with 2 options - Light and Dark.
- Each option has attributes that contain the hex color codes for background, text, etc.
e.g. Page background is set to “#FFFFFF” for Light Mode and “#000000” for Dark Mode. - Each User has a field called Preferred Color Mode that they can set - either Light or Dark.
- Finally I’ll set each element’s color according to the attribute in the User’s Preferred Color Mode, e.g. Current User’s Preferred Color Mode’s Page background





