I absolutely agree that this would be a great idea, but it would be much better to solve this at a higher level - the website should provide a light and dark stylesheet, and then the browser should pick based on whether the user has a dark theme or not. Giving a website information about your physical surroundings (GPS coordinates, ambient light, audio input, etc) should be an extremely conscious choice, made only when there is not a better option (Google Maps cannot recalculate your route upon making a wrong turn if it doesn't know where you are, for example).