Skip to content

README: the logo follows the reader's GitHub theme, so "harness" shows on a light page - #53

Merged
richard-epsilla merged 1 commit into
mainfrom
readme/logo-follows-github-theme
Nov 2, 2026
Merged

richard-epsilla merged 1 commit into
mainfrom
readme/logo-follows-github-theme

Conversation

@richard-epsilla

Copy link
Copy Markdown
Contributor

What was wrong

With a light GitHub theme on a computer set to dark mode, the README header showed only "router": the dark logo's white "harness" disappeared on the light page.

The header was a <picture> whose sources match the system color scheme. GitHub swaps them to its own theme with a script after the page renders. Where that swap does not happen, the system scheme wins and the wrong logo shows.

The fix

The two logos are now separate images marked #gh-light-mode-only and #gh-dark-mode-only, on both the link and the image. GitHub's stylesheet applies these from the reader's GitHub theme, with no script involved. This is how the HarnessRouter README's header already works. Size and position are unchanged.

Checked on github.com

Headless Chromium, with the page's theme attributes set the way a signed-in setting renders them. Eight theme settings were tested, including "sync with system" with its day and night themes, against a light and a dark system:

  • Scripts on: main and this branch both show the right logo in all 16 views each.
  • Scripts off, so the swap never runs:
    • main shows the wrong logo in 7 of 16 views. One of them is a light theme on a dark system, which renders exactly the reported "router" only.
    • This branch shows the full logo there.
    • This branch's remaining misses are all with "sync with system" or colorblind and high-contrast themes. Without scripts GitHub doesn't load those themes either, so some of these rows are artifacts of the test.

🤖 Generated with Claude Code

…s on a light page

The header was a <picture> whose sources match the system color scheme. GitHub swaps them to its own theme with
a script after the page renders; where that does not happen, a reader with a light GitHub theme on a dark system
got the dark logo, whose white "harness" disappears on the light page and leaves only "router". The two logos
now carry #gh-light-mode-only / #gh-dark-mode-only, which GitHub's stylesheet applies from the theme itself,
the way the HarnessRouter README's header does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@richard-epsilla
richard-epsilla merged commit 25f59bc into main Nov 2, 2026
10 checks passed
@richard-epsilla
richard-epsilla deleted the readme/logo-follows-github-theme branch November 2, 2026 21:07
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