Would this make toggling between schemes easier? Suppose there is a button on the page that lets user pick light or dark. What would the js look like?
Easily toggling light/dark is part of the Web Preferences API feature, which is being prototyped in Chrome: https://chromestatus.com/feature/4631882616012800