In this darkmode code I want to be able to detect changes in the system appearance (dark, light, auto) and set the mode in localStorage
darkmode
mode
localStorage