Skip to content

README: drop img heights so GitHub skips its gray placeholder - #19

Merged
subwaymatch merged 1 commit into
mainfrom
claude/tender-hopper-xe39ft
Oct 16, 2026
Merged

subwaymatch merged 1 commit into
mainfrom
claude/tender-hopper-xe39ft

Conversation

@subwaymatch

Copy link
Copy Markdown
Owner

Summary

After #18, the README logo showed on a light gray rounded rectangle.

Cause: when an <img> loads from an absolute raw.githubusercontent.com URL and has both width and height, GitHub's server-side renderer adds this inline style:

aspect-ratio: 152 / 133; background-color: var(--bgColor-muted); border-radius: 6px   (class="js-gh-image-fallback")

It's meant as a loading placeholder, but logo.svg is transparent with semi-transparent shapes, so the gray stays visible behind it.

Fix: keep only width on the logo (152) and on the wordmark (177). The wordmark is inside <picture>, which GitHub doesn't style this way, but I dropped its height too so both images follow the same rule. The SVGs keep their own proportions, so the rendered sizes stay 152×133 and 177×43.

Verification

  • I checked GitHub's server-rendered HTML for a few READMEs:
    • This repo's logo (width and height) gets the placeholder.
    • python-pillow/Pillow's raw.githubusercontent.com logo, which has width and height, gets it too.
    • numpy/numpy's width-only raw.githubusercontent.com logo doesn't.
    • pallets/flask's height-only one doesn't either.
  • A local Chromium render of the header still shows the logo at 152×133 and the wordmark at 177×43, and the wordmark still switches to the dark file in dark mode.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UPUkrGnMDAicigzqmP8keN


Generated by Claude Code

GitHub styles a raw.githubusercontent.com <img> that has both width and
height with a placeholder (background-color: var(--bgColor-muted);
border-radius: 6px). The logo is transparent, so the gray showed through
behind it. With only width set, GitHub leaves the image unstyled, and
the SVGs keep their aspect ratio, so the rendered sizes are unchanged.

The wordmark is inside <picture>, which GitHub does not style this way,
but drop its height too so both images follow the same rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UPUkrGnMDAicigzqmP8keN
@subwaymatch
subwaymatch merged commit e92f85b into main Oct 16, 2026
4 checks passed
@subwaymatch
subwaymatch deleted the claude/tender-hopper-xe39ft branch October 17, 2026 04:19
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.

2 participants