{{- /* The masthead's light/dark switch, both halves of it. Reading the stored choice has to happen here - inline, in
, above the stylesheet - and not from a deferred or end-of-body script: a script that runs after first paint means the page is painted in the wrong theme and then corrected, which is the white flash this whole arrangement exists to avoid. It is a handful of statements precisely because everything in front of it is blocked on them. What it writes is only ever an *override*: `data-theme` is absent until the reader asks for something other than what their OS says, and pressing the switch back to agreement removes it again rather than pinning the same value. So a machine that flips to dark at sunset carries the site with it, which pinning-by-default would quietly break. style.scss's `dark` mixin spells out the matching CSS condition. The two theme-color metas above are wired the same way. While the OS decides they keep their media queries and the browser picks; a pinned theme rewrites the pair so exactly one of them matches, since a browser takes the first theme-color whose media applies and would otherwise go on tinting its chrome from the OS preference alone. The click listener is delegated from the document rather than bound to the button: hx-boost morphs a freshly rendered masthead in on every navigation, and a listener attached to the element it replaces would go with it. Nothing is written onto the button either - which face the icon shows and which of its two labels is the accessible name both fall out of `data-theme` in CSS - so a swap has nothing of ours to revert. */}} {{ if or site.Params.noindex .Params.noindex }} {{ end }}