Skip to content

feat: light-mode SVG variants for GitHub dark theme compatibility#115

Merged
rohitg00 merged 1 commit intomainfrom
feat/readme-darkmode-svg-variants
Apr 12, 2026
Merged

feat: light-mode SVG variants for GitHub dark theme compatibility#115
rohitg00 merged 1 commit intomainfrom
feat/readme-darkmode-svg-variants

Conversation

@rohitg00
Copy link
Copy Markdown
Owner

@rohitg00 rohitg00 commented Apr 12, 2026

Problem

The 30 custom SVG tags from PR #114 have dark backgrounds (`#1A1A1A`). They look great on GitHub's light theme — the dark badges stand out clearly on the white README background.

On GitHub's dark theme, the dark badges blend into the dark README background, hurting readability.

Solution

Add a complete set of light-background SVG variants in `assets/tags/light/` and use GitHub's `` element to auto-swap based on the reader's theme preference.

How GitHub handles it

GitHub supports `prefers-color-scheme` media queries inside `` elements in README files. Pattern:

```html

\"Benchmarks\"

\`\`\`

When the reader is on GitHub dark theme, the browser picks the `media="(prefers-color-scheme: dark)"` source (the light-bg SVG). Otherwise it falls through to the `` default (the dark-bg SVG).

30 light variants

Same dimensions, same orange `#FF6B35` brand accent, same fonts. Changes:

Element Dark variant Light variant
Background `#1A1A1A → #0F0F0F` (dark gradient) `#FFFFFF → #F8F9FB` (white gradient)
Border `#2A2A2A` `#E5E7EB` (GitHub neutral)
Title text `#FFFFFF` `#0F172A` (slate-900)
Subtitle text `#9CA3AF` `#64748B` (slate-500)

Stat card accent colors were darkened slightly for better contrast against white backgrounds:

  • Green: `#00D26A → #16A34A`
  • Orange: `#FF6B35 → #EA580C`
  • Purple: `#B5A4FF → #7C3AED`

Orange brand accent strip is unchanged — it's the consistent brand element across both modes.

README changes

Used a Python regex pass to wrap all 26 tag references in `` elements:

  • 14 section headers (all `

    ` tags)

  • 12 stat cards (6 in hero row × 2 locations — hero + benchmarks section)

No manual edits — one atomic transformation.

Test plan

  • `xmllint` validates all 30 light SVGs parse cleanly
  • `npm test` — 654/654 passing
  • Regex-verified 26 `` elements in README
  • Manual: view README on GitHub with light theme (should see dark badges)
  • Manual: view README on GitHub with dark theme (should see light badges)

Summary by CodeRabbit

  • Style
    • Updated image markup across the README to support dark mode, automatically serving appropriate assets based on user color scheme preferences while maintaining existing light mode appearance.

Adds a full set of light-background SVG tags in assets/tags/light/
that mirror the existing dark-background tags in assets/tags/.

GitHub <picture> element auto-swaps based on the reader's theme:
- GitHub LIGHT theme  → dark-bg SVG (original, stands out on white)
- GitHub DARK theme   → light-bg SVG (new, stands out on dark)

## 30 light variants generated

Same dimensions, same orange #FF6B35 brand accent, same fonts. Only
the backgrounds and text colors change:

- Background: white → light gray gradient (#FFFFFF → #F8F9FB)
- Border: #E5E7EB (GitHub-style neutral border)
- Title text: #0F172A (slate-900)
- Subtitle text: #64748B (slate-500)

Stat values are slightly darkened for better contrast on white:
- Green: #00D26A → #16A34A
- Orange: #FF6B35 → #EA580C
- Purple: #B5A4FF → #7C3AED

## README changes

All 26 tag references now use <picture> elements:

  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/foo.svg">
    <img src="assets/tags/foo.svg" alt="..." height="..." />
  </picture>

Covers: 14 section headers (both stat rows × 6 = 12 stat cards).

No visual changes for light-theme readers — the original dark SVGs
still show. Dark-theme readers now get proper contrast instead of
dark-on-dark blend.

All 30 light SVGs validated with xmllint. 654/654 tests passing.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 12, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f4d061ae-10f8-47cd-8e50-648c6cc55f89

📥 Commits

Reviewing files that changed from the base of the PR and between b317433 and 6432dee.

⛔ Files ignored due to path filters (30)
  • assets/tags/light/divider.svg is excluded by !**/*.svg
  • assets/tags/light/new-v082.svg is excluded by !**/*.svg
  • assets/tags/light/pill-beta.svg is excluded by !**/*.svg
  • assets/tags/light/pill-hook.svg is excluded by !**/*.svg
  • assets/tags/light/pill-mcp.svg is excluded by !**/*.svg
  • assets/tags/light/pill-new.svg is excluded by !**/*.svg
  • assets/tags/light/pill-plugin.svg is excluded by !**/*.svg
  • assets/tags/light/pill-secure.svg is excluded by !**/*.svg
  • assets/tags/light/pill-skill.svg is excluded by !**/*.svg
  • assets/tags/light/pill-stable.svg is excluded by !**/*.svg
  • assets/tags/light/section-agents.svg is excluded by !**/*.svg
  • assets/tags/light/section-api.svg is excluded by !**/*.svg
  • assets/tags/light/section-architecture.svg is excluded by !**/*.svg
  • assets/tags/light/section-benchmarks.svg is excluded by !**/*.svg
  • assets/tags/light/section-competitors.svg is excluded by !**/*.svg
  • assets/tags/light/section-config.svg is excluded by !**/*.svg
  • assets/tags/light/section-development.svg is excluded by !**/*.svg
  • assets/tags/light/section-how.svg is excluded by !**/*.svg
  • assets/tags/light/section-license.svg is excluded by !**/*.svg
  • assets/tags/light/section-mcp.svg is excluded by !**/*.svg
  • assets/tags/light/section-quickstart.svg is excluded by !**/*.svg
  • assets/tags/light/section-search.svg is excluded by !**/*.svg
  • assets/tags/light/section-viewer.svg is excluded by !**/*.svg
  • assets/tags/light/section-why.svg is excluded by !**/*.svg
  • assets/tags/light/stat-deps.svg is excluded by !**/*.svg
  • assets/tags/light/stat-hooks.svg is excluded by !**/*.svg
  • assets/tags/light/stat-recall.svg is excluded by !**/*.svg
  • assets/tags/light/stat-tests.svg is excluded by !**/*.svg
  • assets/tags/light/stat-tokens.svg is excluded by !**/*.svg
  • assets/tags/light/stat-tools.svg is excluded by !**/*.svg
📒 Files selected for processing (1)
  • README.md

📝 Walkthrough

Walkthrough

README.md updated to serve dark-mode image assets using responsive <picture> markup with media queries, replacing static <img> tags across multiple section headings and stat images throughout the document.

Changes

Cohort / File(s) Summary
README Image Markup
README.md
Replaced static <img> tags for stats and section headers with responsive <picture> elements that conditionally serve dark-mode assets via <source media="(prefers-color-scheme: dark)"> while maintaining fallback <img> elements. Applied consistently across top stats row and 13+ section headings including works-with-every-agent, benchmarks, vs-competitors, quick-start, why-agentmemory, how-it-works, search, mcp-server, real-time-viewer, configuration, api, architecture, development, and license.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Poem

🐰 In darkness deep, the images gleam,
A picture tag fulfills the dream—
Light or dark, both paths align,
Responsive beauty by design! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly summarizes the main change: adding light-mode SVG variants for GitHub dark theme compatibility, which is the primary objective of the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/readme-darkmode-svg-variants

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@rohitg00 rohitg00 merged commit 649e6e4 into main Apr 12, 2026
3 checks passed
@rohitg00 rohitg00 deleted the feat/readme-darkmode-svg-variants branch April 12, 2026 19:28
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