Dispatch event on appearance change #876
Unanswered
alxndrmlr
asked this question in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Great work on the new Dark Mode/Appearance functionality Caleb!
I was source diving to see if there was an easy way for me to listen and react to when the appearance changes, and I found my way to
I'm not an javascript expert, but my understand is that its not easy for me to "listen to value changes on the window" unless you use a "proxy object"...
It would be nice if at the end of this method you could do the following
Or something to that effect, that way some of my code (chart.js for example) could listen and react to that so the charts could re-render with the proper dark mode colors. Example from my code...
Currently I'm using my own setters for the theme (I had built this before) and ran into needing to retain that when I migrated to the "Flux native approach" wherein I will dispatch my own event.
The other place I use this is I also toggle some style sheets for
highlight.js
when the appearance changes. Example of my current code...Beta Was this translation helpful? Give feedback.
All reactions