Expand description
Light and dark, read once for both halves of the page.
The chrome is Tailwind and the diagram is the app’s palette, but which end
of the axis each is drawn at is one reading: the class the root carries and
the Palette the kernel is told come from the same answer, so the bar and
the ground cannot disagree. The preference itself is
blockworx_paint::Mode, kept in crate::prefs; what is here is the
browser’s own answer and the class the chrome varies on.
Enums§
- Prefers
- What the browser answers for
prefers-color-scheme: dark.Unstatedis an engine that does not answer the query at all, which is not the same as answering “light”.
Constants§
- DARK 🔒
- The query
Mode::Systemfollows.
Functions§
- luminance
- Which end of the axis the page is drawn at.
- root_
class - The class the root element carries so Tailwind’s
dark:variant applies —tailwind.csskeys that variant off the class rather than the media query, which is what lets one reading drive both halves. - watch
- Follow the system preference for as long as the page is open:
toldis called whenever the browser changes its mind, which is what keepsMode::Systemactually following rather than sampling once at startup.