darkmode.js, Said Achmiz2020-03-20 (; backlinks)⁠:

Javascript library for creating a theme widget controlling page appearance, toggling between automatic (OS-set), and manual ‘light’ vs ‘dark mode’. This library saves the setting to local storage, and avoids the bugs of cruder inversion-based dark-mode JS libraries where setting dark-mode during the day means it’ll automatically set light-mode at night.

Because many users do not have access to a browser/OS which explicitly supports dark mode, cannot modify the browser/OS setting without undesired side-effects, wish to opt in only for specific websites, or simply forget that they turned on dark mode & dislike it, we make dark mode controllable by providing a widget at the top of the page.