> The site won't retain the user's choice if you use plain CSS which is pretty horrible
Correct, that's why the suggested solution here is just as bad.
"Plain CSS" dark mode just follows your device’s setting via `prefers-color-scheme` @media query. Anything else is just unnecessary and should be suppressed. Just set your whole system once and be done.
That "Plain CSS" works perfectly and indeed does not need any JS nor different URLs (wut? who does that.)