No listeners. No event handlers. The checkbox acts as the trigger. Using :root:has (.darkMode:checked), you redefine your CSS variables when the toggle is active. The entire UI updates in real time ...