Skip to content

fix: theme-aware README logo + docs preview CI#545

Merged
ochafik merged 3 commits intomainfrom
fix/readme-logo-theme
Mar 10, 2026
Merged

fix: theme-aware README logo + docs preview CI#545
ochafik merged 3 commits intomainfrom
fix/readme-logo-theme

Conversation

@localden
Copy link
Contributor

@localden localden commented Mar 10, 2026

Summary

Three related changes around README/docs theming:

  1. README logo → <picture> element — fix double-logo rendering on npm/VS Code
  2. Sync logo with TypeDoc theme switcher — fix wrong logo when user overrides OS theme
  3. Cloudflare Pages PR preview for docs — per-PR preview deployments so changes like this are reviewable

1. README: use <picture> instead of URL-fragment hack

The README used GitHub's legacy #gh-light-mode-only / #gh-dark-mode-only URL fragments. That only works when github.com's stylesheet is loaded — on npm, VS Code markdown preview, and other renderers the fragments are ignored and both <img> tags render, showing two stacked logos.

Switched to <picture> with prefers-color-scheme sources (GitHub's recommended approach). Degrades gracefully to the light logo where <picture> isn't supported.

2. Docs site: make the logo follow the TypeDoc theme switcher

<picture> with prefers-color-scheme only tracks the OS setting. TypeDoc's theme switcher writes data-theme="light"|"dark"|"os" on <html>, so manually picking Light while the OS is dark would show the white logo on a light background.

Fixed in the docs build only (README source unchanged):

  • typedoc-plugin-mcpstyle.mjs rewrites the <picture> into two class-tagged <img> elements
  • mcp-theme.css hides the inactive one keyed on data-theme (explicit selection) and prefers-color-scheme (for "os" mode)

Also applied prettier to mcp-theme.css (tabs → spaces, quote normalization) — it hadn't been formatted before.

3. CI: Cloudflare Pages preview for docs PRs

New .github/workflows/docs-preview.yml deploys the built TypeDoc site to Cloudflare Pages project mcp-ext-apps-docs-preview on PRs touching docs/**, src/**, README.md, or typedoc config. Uses the shared modelcontextprotocol/actions/cloudflare-pages-preview composite action:

  • Posts/updates a sticky PR comment with preview URLs
  • Injects noindex headers so previews aren't crawled
  • Cleans up deployments on PR close
  • Skips fork PRs (no secret access)

Requires repo secrets: CF_PAGES_PREVIEW_API_TOKEN and CF_PAGES_PREVIEW_ACCOUNT_ID.

The #gh-light-mode-only / #gh-dark-mode-only URL fragments only work
on github.com. On npm, VS Code preview, and other markdown renderers
both img tags render, showing two stacked logos.

Switch to <picture> with prefers-color-scheme, which GitHub recommends
and which degrades gracefully to a single logo elsewhere.
@localden localden added the documentation Improvements or additions to documentation label Mar 10, 2026
@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 10, 2026

Open in StackBlitz

@modelcontextprotocol/ext-apps

npm i https://pkg.pr.new/@modelcontextprotocol/ext-apps@545

@modelcontextprotocol/server-basic-preact

npm i https://pkg.pr.new/@modelcontextprotocol/server-basic-preact@545

@modelcontextprotocol/server-basic-react

npm i https://pkg.pr.new/@modelcontextprotocol/server-basic-react@545

@modelcontextprotocol/server-basic-solid

npm i https://pkg.pr.new/@modelcontextprotocol/server-basic-solid@545

@modelcontextprotocol/server-basic-svelte

npm i https://pkg.pr.new/@modelcontextprotocol/server-basic-svelte@545

@modelcontextprotocol/server-basic-vanillajs

npm i https://pkg.pr.new/@modelcontextprotocol/server-basic-vanillajs@545

@modelcontextprotocol/server-basic-vue

npm i https://pkg.pr.new/@modelcontextprotocol/server-basic-vue@545

@modelcontextprotocol/server-budget-allocator

npm i https://pkg.pr.new/@modelcontextprotocol/server-budget-allocator@545

@modelcontextprotocol/server-cohort-heatmap

npm i https://pkg.pr.new/@modelcontextprotocol/server-cohort-heatmap@545

@modelcontextprotocol/server-customer-segmentation

npm i https://pkg.pr.new/@modelcontextprotocol/server-customer-segmentation@545

@modelcontextprotocol/server-debug

npm i https://pkg.pr.new/@modelcontextprotocol/server-debug@545

@modelcontextprotocol/server-map

npm i https://pkg.pr.new/@modelcontextprotocol/server-map@545

@modelcontextprotocol/server-pdf

npm i https://pkg.pr.new/@modelcontextprotocol/server-pdf@545

@modelcontextprotocol/server-scenario-modeler

npm i https://pkg.pr.new/@modelcontextprotocol/server-scenario-modeler@545

@modelcontextprotocol/server-shadertoy

npm i https://pkg.pr.new/@modelcontextprotocol/server-shadertoy@545

@modelcontextprotocol/server-sheet-music

npm i https://pkg.pr.new/@modelcontextprotocol/server-sheet-music@545

@modelcontextprotocol/server-system-monitor

npm i https://pkg.pr.new/@modelcontextprotocol/server-system-monitor@545

@modelcontextprotocol/server-threejs

npm i https://pkg.pr.new/@modelcontextprotocol/server-threejs@545

@modelcontextprotocol/server-transcript

npm i https://pkg.pr.new/@modelcontextprotocol/server-transcript@545

@modelcontextprotocol/server-video-resource

npm i https://pkg.pr.new/@modelcontextprotocol/server-video-resource@545

@modelcontextprotocol/server-wiki-explorer

npm i https://pkg.pr.new/@modelcontextprotocol/server-wiki-explorer@545

commit: ab8f9cf

Deploys a per-PR preview of the TypeDoc site to Cloudflare Pages project
mcp-ext-apps-docs-preview when docs, src JSDoc, README, or typedoc config
change. Uses the shared modelcontextprotocol/actions composite action that
injects noindex headers, posts a sticky PR comment with preview URLs, and
cleans up deployments on PR close. Fork PRs are skipped (no secret access).
@github-actions
Copy link
Contributor

github-actions bot commented Mar 10, 2026

Preview

Preview deployments for this PR have been cleaned up.

The README <picture> logo uses prefers-color-scheme, which only follows
the OS setting. TypeDoc's theme switcher sets data-theme on <html>, so
manually picking Light/Dark would show the wrong logo (e.g. white logo
on light background if OS is dark but user picked Light).

Rewrite the <picture> in the generated docs into two class-tagged <img>s
via the mcpstyle plugin, and hide the inactive one via CSS keyed on both
data-theme (explicit selection) and prefers-color-scheme (OS mode). The
README source is unchanged so GitHub/npm still get <picture>.

Also: prettier normalized mcp-theme.css (tabs to spaces, quote style).
@ochafik ochafik merged commit a870456 into main Mar 10, 2026
22 checks passed
@localden localden changed the title fix(readme): use picture element for theme-aware logo fix: theme-aware README logo + docs preview CI Mar 10, 2026
@ochafik ochafik deleted the fix/readme-logo-theme branch March 10, 2026 17:38
ochafik added a commit that referenced this pull request Mar 10, 2026
Changes since 1.2.0:
- fix: bundle SDK+zod in react-with-deps (was byte-identical to ./react) (#539)
- fix(build): copy schema.json to dist and externalize zod (#534)
- fix: skip debug log for high-frequency tool-input-partial notifications (#546)
- fix(deps): drop @hono/node-server override to patch GHSA-wc8c-qw6v-h7f6 (#535)
- fix(readme): use picture element for theme-aware logo (#545)
- fix(ci): require maintainer association for /update-snapshots trigger (#532)
- fix: pre-commit stages only originally-staged files; add .npmrc (#538)
- ci: use npm ci with caching, validate typedoc links, align Node versions (#533)
- test: exclude screenshot-gen from default E2E run; wire pdf-server tests (#537)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants