summaryrefslogtreecommitdiffstats
path: root/assets/js/subscribe_widget.js
diff options
context:
space:
mode:
authorpsvenk <45520974+psvenk@users.noreply.github.com>2019-08-15 16:29:55 +0000
committerOmar Roth <omarroth@protonmail.com>2019-08-15 11:29:55 -0500
commitf54fbd057ebb8d1e9631782b6d182b403598648f (patch)
treefb2e56fed7d71bbcdeff59b711803057af330ca9 /assets/js/subscribe_widget.js
parent19eceb4ecc8b8261c6268f82b8c5d550604e9f4f (diff)
downloadinvidious-f54fbd057ebb8d1e9631782b6d182b403598648f.tar.gz
invidious-f54fbd057ebb8d1e9631782b6d182b403598648f.tar.bz2
invidious-f54fbd057ebb8d1e9631782b6d182b403598648f.zip
Add prefers-color-scheme support (#601)
* Add prefers-color-scheme support This should fix <https://github.com/omarroth/invidious/issues/559>. The cookie storage format has been changed from boolean ("true"/"false") to tri-state ("dark"/"light"/""), so that users without a cookie set will get dark mode if they have enabled the dark theme in their operating system. The code for handling the cookie state, along with the user's operating system theme, has been factored out into a new function `update_mode`, which is called both at window load and at the "storage" event listener, because the "storage" event listener is only trigerred when a change is made to the localStorage from another tab/window (for more info - see <https://stackoverflow.com/a/4679754>).
Diffstat (limited to 'assets/js/subscribe_widget.js')
0 files changed, 0 insertions, 0 deletions