Both iOS and Android allow you to set dark mode by some schedule, and that's conveyed by their respective browsers to websites.
Well, it is in KDE + Firefox. And yeah, the simplistic idea that day = bright and night = dark fails all the time, the OS has already other settings to deal with those failures, and your site or app should just use the system theme.