From 560d251daaa65cb0c75f5ca095639cc921a1b78d Mon Sep 17 00:00:00 2001 From: Eric Boehs Date: Sat, 29 Aug 2026 22:32:43 -0500 Subject: [PATCH 1/2] fix: tint only the points in dark mode, not the story titles Story titles go back to UIkit's .uk-light white; the blue is now confined to the points column, which is what was actually wanted. Also fixes a claim in the previous PR. It said the story detail page title was fixed, but views/story.erb never made it into the commit -- a `git checkout views/story.erb` while probing ETag behaviour reverted the uncommitted change first. The file was absent from the merge. That page should keep white titles now anyway, so nothing needs adding back. Visited points keep the grey they already had: the new rules are more specific than `table a:visited`, so without an explicit rule they would have started overriding it and clicked stories would stop dimming. Verified in the browser per scheme. Dark: title rgb(255,255,255), points rgb(88,166,255). Light: unchanged at rgb(13,13,13) with the high-score highlight still rgb(30,135,240). One consequence worth naming: light mode distinguishes ordinary points from high-scoring ones by colour, and tinting every point blue flattens that distinction in dark mode. --- views/layout.erb | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/views/layout.erb b/views/layout.erb index 898a6a8..2fef4d2 100644 --- a/views/layout.erb +++ b/views/layout.erb @@ -48,19 +48,19 @@ /* Pure black rather than #222 so OLED pixels switch off entirely. */ html.hn-dark, html.hn-dark body { background-color: #000 } - /* .uk-light paints every link #fff, leaving a story title nearly - indistinguishable from the translucent white body text around it. - #58a6ff restores the link affordance and measures 8.3:1 on black - (WCAG AAA); UIkit's own #1e87f0 only reaches 5.8:1. */ - .hn-dark .uk-light .story a, - .hn-dark .uk-light table a { color: #58a6ff } - - /* Visited links in the listing stay dimmed, the way HN does it. */ - .hn-dark .uk-light table a:visited { color: #999 } - - /* .uk-light also forces .uk-text-primary to #fff !important, which - loses the high-score highlight completely. */ - .hn-dark .uk-light .uk-text-primary { color: #58a6ff !important } + /* Only the points are tinted. Titles keep UIkit's .uk-light white. + #58a6ff measures 8.3:1 on black (WCAG AAA); UIkit's own #1e87f0 + only reaches 5.8:1. */ + .hn-dark .uk-light .points { color: #58a6ff } + + /* .uk-light forces .uk-text-primary to #fff !important, so the + high-score variant has to be reclaimed with !important too. */ + .hn-dark .uk-light .points.uk-text-primary { color: #58a6ff !important } + + /* Visited stories dim to grey in light mode; keep that here rather + than let the rules above override it. Last so it beats the + equally-specific !important rule above. */ + .hn-dark .uk-light .points:visited { color: #999 !important } /* #DDD thread borders measure 15:1 on black, louder than the text they sit beside. */ From 9984414098c9d1f05a7f514aaa36344361a64787 Mon Sep 17 00:00:00 2001 From: Eric Boehs Date: Sat, 29 Aug 2026 22:35:21 -0500 Subject: [PATCH 2/2] docs: correct two comments about visited-link behaviour Visited listing titles are grey, not white -- the global `table a:visited` outranks UIkit. And the visited rule preserves grey *points* in dark mode, where the new scoped selectors would otherwise outrank that global rule; light mode was never affected. --- views/layout.erb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/views/layout.erb b/views/layout.erb index 2fef4d2..4e181aa 100644 --- a/views/layout.erb +++ b/views/layout.erb @@ -48,18 +48,20 @@ /* Pure black rather than #222 so OLED pixels switch off entirely. */ html.hn-dark, html.hn-dark body { background-color: #000 } - /* Only the points are tinted. Titles keep UIkit's .uk-light white. - #58a6ff measures 8.3:1 on black (WCAG AAA); UIkit's own #1e87f0 - only reaches 5.8:1. */ + /* Only the points are tinted. Unvisited titles keep UIkit's + .uk-light white; visited ones stay grey via `table a:visited` + above. #58a6ff measures 8.3:1 on black (WCAG AAA); UIkit's own + #1e87f0 only reaches 5.8:1. */ .hn-dark .uk-light .points { color: #58a6ff } /* .uk-light forces .uk-text-primary to #fff !important, so the high-score variant has to be reclaimed with !important too. */ .hn-dark .uk-light .points.uk-text-primary { color: #58a6ff !important } - /* Visited stories dim to grey in light mode; keep that here rather - than let the rules above override it. Last so it beats the - equally-specific !important rule above. */ + /* Keeps visited points grey: the two rules above are more specific + than the global `table a:visited` and would otherwise outrank it, + so clicked stories would stop dimming in dark mode only. Declared + last so it also beats the equally-specific !important rule. */ .hn-dark .uk-light .points:visited { color: #999 !important } /* #DDD thread borders measure 15:1 on black, louder than the text