themecheck

command
v0.0.0-...-1b85559 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2026 License: BSD-3-Clause Imports: 18 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command themecheck proves, in a real browser, that the canvas follows the page's theme — both when the reader chooses one and when the machine changes its mind underneath them.

⛔ A VALUE READ ONCE AT START-UP CANNOT FOLLOW A CHANGE, and a check that loads a page once cannot see whether it did. cmd/pagecheck asks Chrome for a single screenshot and judges it, which is the right shape for "did the editor draw"; it is the wrong shape for this, because the defect this guards is invisible until something changes AFTER the page has settled.

So the three states are driven, in order, on one loaded page:

light          the system setting, emulated      the canvas is light
dark           the system setting, changed       the canvas turns dark
data-theme     the reader's toggle, written      the canvas turns light

The second proves the prefers-color-scheme listener, the third the MutationObserver. Before the listeners existed the canvas held whatever it read in main() and both of the last two rows failed.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL