<meta name="color-scheme" content="dark light" /> in the <head>, then the browsers defaults already provide dark mode defaults. If you overwrite with your own color scheme, use light-dark(#fff, #000) (obviously, you can use variables too) to define a color with light and dark variants in-place.
So, no explicit toggle. Just respect my browser/system defaults.
(It's not really visible because of the inline code coloring, but I linked the MDN docs on both.)