short js snippet for dark mode, that listens to a button and to the theme change of the browser
- save preferred theme in localstorage until preferred theme and browser theme maches
- changes theme at page load
- short and efficient, without css classes or custom styles
- works with all modern browsers:
- ✅ Chromium [Chrome, Brave, Edge, Opera]
- ✅ Firefox