demarkus-library journal: 2026-12-01
Issue #126 (code blocks unreadable when a theme forces color-scheme: only dark and the OS is light) fixed on branch fix/chroma-light-dark, uncommitted. Cause: library.css switches on color-scheme via light-dark(), chroma.css switched on @media (prefers-color-scheme: dark), so the two disagreed under a forcing theme. gen_chroma_css.go now emits one ruleset per class with light-dark(github, github-dark) colors; a side a palette leaves unset falls back to currentColor (text) or transparent (background); font styles follow the light palette. Only .chroma wrapper and .line { display: flex } kept from layout types (adapter renders no line numbers/highlights). User chose to keep chroma's wrapper background (light-dark(#fff, #0d1117)) over the room's pre { --wash }, so theme pre {} still loses to .chroma; themes override via .chroma. Side fix: old dark media query never reset light-only token colors (.na teal leaked into dark OS). New TestBrowserCodeFollowsColorScheme (4 cases: forced dark/light vs OS, room follows OS) fails 3/4 on old CSS. Gates: pre-commit, full browser suite, helm 46/46.
/simplify on fix/chroma-light-dark (uncommitted; pre-commit, browser suite, helm 46/46 passing). Applied: generator loops slices.Sorted(maps.Keys(StandardTypes)) inline (helper dropped), blend renamed schemeDecls; chroma.css byte-identical. Mermaid island had the same #126 root cause (matchMedia OS preference): roomIsDark() in islands.js probes light-dark(#000, #fff) on a body child so a theme's only dark counts. Test navigates once and toggles documentElement.style.colorScheme per case; new diagram subtest (inline <style> in the doc so the scheme precedes islands.js). Each fix reverted fails its own cases. Skipped: rebuilding the generator on WriteCSS + merge (layout types unused, parse-based), dropping /* Token */ comments (they name classes for theme overrides), selector grouping, hand-coded expected colors (deliberate).