themer was made as a part of commitlog-web. To support both system preference and manual selection by users for the base theme of an app. It bases off it's decision based on the state set by the user. If a user is visiting the site for the first time the state is set to pick the current system preference and set that as the chosen theme
If the user then decides to switch the theme using the toggle, the selected theme is set as a permanent preference for that website unless the site data is cleared from the browser.
A demo of the above can be seen both at commitlog-web and on this very site.
or you could use the below custom implementation
Install `@barelyreaper/themer` if using a bundler or add this to your html scripts.