Open wridgeu opened 4 years ago
There is something like a single source of truth needed regarding theme toggling. It needs to somehow be managed by a model.
Model holds value whether or not we're in Dark or Light Mode -> According to the model Value we need to set some DOM-Data-Element or something like that in order to have a stable way to retrieve the current state of the theme - according to this we then have to adjust our CSS
The sidebar might be a good option to start with.
Try to use less direct access to view and control view via model (state) of the application => add more view-models and control the state of the view via those models instead of directly influencing it with .byId().