Predicate chips and graph are illegible (dark-on-dark) under OS-enforced prefers-color-scheme: dark #72
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
When the user's OS enforces dark mode (
prefers-color-scheme: dark), two zetl UI elements become illegible (dark-on-dark):.zetl-edge-predicate) — near-black text/background./_graphand the docked mini-widget) — node labels and surfaces are very low-contrast.The rest of the page background follows OS dark mode (via the compiled base theme), but these two components are styled with light-only colours, so they end up black-on-dark.
Affects zetl 0.9.2, default theme.
Root cause
zetl's own component styles define light-only colours and have no
@media (prefers-color-scheme: dark)override (the page is also pinned todata-theme="default"), while the base theme background does react to OS dark mode — so only these custom components fall out of sync.Predicate chips
themes/default/static/shell.css(.zetl-edge-predicate, ~line 171) hardcodes black:There is no
prefers-color-scheme: darkrule anywhere inshell.css.Graph
themes/default/static/graph-boot.jsnodeReducer/edgeReducerread--zetl-graph-*custom properties viagetComputedStyle(refreshed onprefers-color-schemechange — see_graph.html), and the widget chrome uses light fallbacks:The
--zetl-graph-*/--zetl-shell-*tokens are only defined for the light theme, so under OS dark mode the labels/nodes/surfaces keep their light values and lose contrast. (The reducers already re-render onprefers-color-schemechange — there's just nothing dark to read.)Reproduction
zetl buildpage (e.g. https://anti-violence-tech.pages.dev/research/datafication-of-metoo/).predicatechips (e.g.Studies,Related to) render as dark text on a dark background./_graph— node labels and the widget surface are very low contrast.Expected
Predicate chips and graph labels/surfaces should remain legible under
prefers-color-scheme: dark, matching the dark page background.Suggested fix
Add dark-mode values for the custom components — either:
@media (prefers-color-scheme: dark)block inshell.cssoverriding.zetl-edge-predicatecolours and the--zetl-shell-*/--zetl-graph-*token defaults, and/orcolor: color-mix(in srgb, currentColor 60%, transparent)/ daisyUIbase-contentvariables — so they track whatever theme/color-schemeis active automatically.A regression check could assert the chip
color/backgroundand the--zetl-graph-*tokens resolve to a dark-mode-appropriate value whenprefers-color-scheme: dark.