Skip to content

docs: serve theme-aware logo variants in readme#242

Merged
wadakatu merged 1 commit into
mainfrom
chore/theme-aware-logo
May 14, 2026
Merged

docs: serve theme-aware logo variants in readme#242
wadakatu merged 1 commit into
mainfrom
chore/theme-aware-logo

Conversation

@wadakatu
Copy link
Copy Markdown
Collaborator

Summary

Split the single images/logo.png asset into logo-dark.png (existing artwork, on its black canvas) and logo-light.png (luminance-flipped variant for white backgrounds), then switch the README header to a <picture> element that follows the GitHub theme.

Why

The original logo was a white mark on a black canvas. On GitHub's light theme it rendered as a hard black rectangle at the top of the README — readable, but disruptive to the page flow. A theme-aware <picture> lets the logo blend with the surrounding canvas on both themes without losing brand recognizability.

The green accent (shield check, end-cap dots, "-contract-testing" suffix) is preserved across both variants so the mark reads as the same logo regardless of theme.

Verification

  • Light variant generated by per-pixel luminance flip with green pixels masked out (keeps the accent intact rather than naive RGB inversion which would turn green into magenta).
  • <picture> fallback <img> points at the light variant — most off-GitHub renderers (Packagist mirror, social shares preview) draw on white and do not honor prefers-color-scheme.
  • Confirmed both PNGs render correctly side-by-side locally.

Notes for reviewers

If the light variant looks too clinical, the trivially-tweakable knobs are in commit 760d915: the dark-text floor color (currently (18, 22, 28) for warmth) and the green-pixel detection threshold. Happy to dial either.

split the single logo asset into dark and light variants and switch
the readme header to a <picture> element so the rendered logo follows
the github theme. the light variant uses dark glyphs on a near-white
background, keeping the green accent in both versions so the brand
mark stays consistent across themes.

the fallback inside <picture> points at the light variant because
readers on platforms that don't honor prefers-color-scheme (most
social shares, packagist's readme mirror) typically render on white.
@wadakatu wadakatu enabled auto-merge (squash) May 14, 2026 08:53
@wadakatu wadakatu self-assigned this May 14, 2026
@wadakatu wadakatu disabled auto-merge May 14, 2026 08:57
@wadakatu wadakatu merged commit 5001b51 into main May 14, 2026
16 checks passed
@wadakatu wadakatu deleted the chore/theme-aware-logo branch May 14, 2026 08:57
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