Skip to content

feat: soften dark mode foreground from pure white to 87% white - #34

Merged
ericboehs merged 1 commit into
masterfrom
feat/dark-mode-off-white
Aug 30, 2026
Merged

feat: soften dark mode foreground from pure white to 87% white#34
ericboehs merged 1 commit into
masterfrom
feat/dark-mode-off-white

Conversation

@ericboehs

Copy link
Copy Markdown
Owner

Pure white on pure black measures 21:1, which glares on OLED. #dedede is Material's high-emphasis level for dark themes (87% white):

on #000
pure white (before) 21.00:1
#dedede (after) 15.61:1
UIkit muted body text 10.02:1
visited grey #999 7.37:1
high-score blue #58a6ff 8.31:1

Still comfortably separated from the muted body text and the visited grey, so the hierarchy is preserved.

Comment headers were the catch

.uk-light colours headings directly, and .uk-accordion-title is a div — so the anchor rule never reached it. Comment headers were the one thing still rendering pure white after the first pass, and unlike the h1/h3 wrappers that's visible text. Found by sweeping every element's computed colour rather than trusting the selectors.

Verification

Browser-driven across both pages and both schemes:

site heading story title ordinary points high-score comment header any pure white
home / dark #dedede #dedede #dedede #58a6ff none
story / dark #dedede #dedede #dedede none
home / light rgb(13,13,13) rgb(13,13,13) rgb(13,13,13) rgb(30,135,240) 1 (pre-existing)
story / light rgb(13,13,13) rgb(13,13,13) rgb(51,51,51) none

Light mode is untouched. The one white anchor light mode reports is the active subnav pill on its blue background — confirmed present identically on master, so it predates this change.

Visited dimming is reinstated explicitly, since the new rule outranks the global table a:visited and would otherwise stop clicked stories greying out in dark mode only.

Tests: 119 runs, 320 assertions.

Pure white on pure black measures 21:1, which glares on OLED. Material's
high-emphasis level for dark themes is 87% white; #dedede drops it to
15.6:1 while staying clearly above the muted body text UIkit already
applies (~10:1) and the visited grey (7.4:1).

Headings and the comment header need their own selectors. .uk-light
colours headings directly, and .uk-accordion-title is a div, so the
anchor rule never reached it -- comment headers were the one thing still
rendering pure white after the first pass, and they are visible text
rather than an empty wrapper.

Visited dimming is reinstated because the new rule outranks the global
`table a:visited`, which would otherwise stop clicked stories greying out
in dark mode only.

Verified in the browser across both pages and both schemes. Dark: every
foreground rgb(222,222,222), high-score points still rgb(88,166,255), and
a sweep for any element computing to pure white returns empty. Light is
untouched. The one white anchor light mode reports is the active subnav
pill on its blue background, present identically on master.
@ericboehs
ericboehs merged commit 7368296 into master Aug 30, 2026
2 checks passed
@ericboehs
ericboehs deleted the feat/dark-mode-off-white branch August 30, 2026 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant