feat: soften dark mode foreground from pure white to 87% white - #34
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pure white on pure black measures 21:1, which glares on OLED.
#dededeis Material's high-emphasis level for dark themes (87% white):#dedede(after)#999#58a6ffStill comfortably separated from the muted body text and the visited grey, so the hierarchy is preserved.
Comment headers were the catch
.uk-lightcolours headings directly, and.uk-accordion-titleis adiv— so the anchor rule never reached it. Comment headers were the one thing still rendering pure white after the first pass, and unlike theh1/h3wrappers 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:
#dedede#dedede#dedede#58a6ff#dedede#dedede#dededergb(13,13,13)rgb(13,13,13)rgb(13,13,13)rgb(30,135,240)rgb(13,13,13)rgb(13,13,13)rgb(51,51,51)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:visitedand would otherwise stop clicked stories greying out in dark mode only.Tests: 119 runs, 320 assertions.