Skip to content

docs: modernize the site theme#3057

Merged
maxisbey merged 2 commits into
mainfrom
docs-polish
Jul 2, 2026
Merged

docs: modernize the site theme#3057
maxisbey merged 2 commits into
mainfrom
docs-polish

Conversation

@maxisbey

@maxisbey maxisbey commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

A visual pass over the docs site. No content changes and no layout restructure; the sidebar keeps its always-expanded sections, it just finally looks like a hierarchy.

Motivation and Context

The site was running essentially stock Material: placeholder logo, no favicon (both were TODOs in mkdocs.yml), default Roboto, washed-out 300-weight headings, and sidebar section children rendered flush under their group labels, so the nav read as one flat list. This brings the site in line with the MCP brand and with what comparable Material sites (pydantic, uv, ruff) do.

What changed:

  • Sidebar hierarchy (docs/extra.css): Material cancels its own child indent under navigation.sections (margin-left: -.6rem); restoring it plus a subtle guide line, small uppercase section labels, tighter spacing, and hiding the duplicated site-name row. All rules are scoped to the desktop breakpoint, so the mobile drawer keeps stock styling.
  • Brand: the MCP mark as header logo (currentColor SVG) and favicon, copied from the spec repo's docs assets (the same pattern csharp-sdk uses); Inter / JetBrains Mono, matching modelcontextprotocol.io and the TypeScript SDK docs; headings at 600 weight and full foreground color.
  • Navigation features: navigation.prune (the collapsed 109-link API Reference subtree no longer ships in every page's HTML; nav anchors on a guide page drop from 167 to 76), navigation.instant + .progress + .prefetch, navigation.footer (prev/next links), navigation.top.
  • Dark mode: the slate palette entry moves from primary: white to primary: black. The only palette rule that colors the header keys off primary=black, so this makes the near-black dark header deliberate; link colors are identical for both values (#5e8bde).

How Has This Been Tested?

mkdocs build --strict is green. Verified on a served build in a browser: instant navigation swaps pages without full reloads, pruning drops the API subtree from guide pages, footer prev/next and the back-to-top button render, dark mode has a near-black header and readable code blocks, the mobile drawer drill-down is unchanged, search works, and code annotation markers render on the What's new page. The Cloudflare preview on this PR is the easiest place to click around.

Breaking Changes

None. Fonts are now loaded from Google Fonts (Material's standard theme.font mechanism); happy to switch to font: false or self-hosting if that's a concern.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

theme.custom_dir: docs/.overrides is new and required for theme.icon.logo; it also makes the pre-existing custom_icons: docs/.overrides/.icons emoji option point at a directory that actually exists. Deliberately not enabled: navigation.expand (would open all 109 API links), toc.integrate (documented conflict with navigation.indexes), navigation.tabs (a bigger layout change than this PR wants to be).

AI Disclaimer

Sidebar: restore the child indent that navigation.sections cancels, add a
guide line, uppercase muted section labels, tighter nav rhythm, and hide the
duplicated site-name row. All scoped to the desktop breakpoint; the mobile
drawer keeps stock styling.

Brand: use the MCP mark as header logo (currentColor SVG) and favicon,
copied from the spec repo's docs assets; set Inter / JetBrains Mono to match
modelcontextprotocol.io and the TypeScript SDK docs; give headings a solid
weight and full foreground color instead of the 300-weight light gray.

Navigation: enable navigation.prune (drops the collapsed API Reference
subtree from every page's HTML), navigation.instant with progress and
prefetch, navigation.footer prev/next links, and navigation.top. Switch the
slate palette entry to primary black so the dark-mode header is deliberately
near-black (link colors are identical for black and white primaries).
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

📚 Documentation preview

Preview https://pr-3057.mcp-python-docs.pages.dev
Deployment https://6ed3a625.mcp-python-docs.pages.dev
Commit 3981cc3
Triggered by @maxisbey
Updated 2026-07-02 15:06:25 UTC

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

Re-trigger cubic

The logo SVG carried fill="none" only on the root element; Material's
.md-logo svg { fill: currentcolor } rule overrides a root presentation
attribute, so the three open stroke paths rendered as a solid filled shape.
Declaring fill="none" on each path wins over the inherited CSS value.

Font weights move from 600 to 700: the theme's Google Fonts request only
loads Inter at 300/400/700, so 600 was already substituting the 700 face
with the webfont while rendering a lighter true-600 on the system fallback
stack. The ltr/rtl rule pairs collapse into margin-inline-start and
border-inline-start, which tie Material's physical outdent at equal
specificity and win on source order.

Cap mkdocs-material below 10: extra.css deliberately overrides
theme-internal nav selectors, so a major bump should revisit it.
@maxisbey maxisbey merged commit 2359b40 into main Jul 2, 2026
38 checks passed
@maxisbey maxisbey deleted the docs-polish branch July 2, 2026 15:17

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — docs-site-only theme changes (mkdocs config, CSS, SVG assets) with no impact on the published package or runtime code.

Extended reasoning...

Overview

The PR touches only the documentation site: two new static SVG assets (the MCP logo mark and a favicon), a new docs/extra.css with sidebar/heading styling scoped to Material's desktop breakpoint, theme configuration in mkdocs.yml (fonts, logo, favicon, dark-mode primary color, and additional navigation.* features), and an upper bound (<10) on mkdocs-material in the docs dependency group with a matching uv.lock specifier update. No source code, tests, or published-package dependencies are modified.

Security risks

None of substance. The SVGs are static path-only assets copied from the spec repo (no scripts or external references), the CSS contains only presentational rules, and the config change stays within Material's documented options. The one externally visible effect is that the docs site now loads Inter/JetBrains Mono from Google Fonts via Material's standard theme.font mechanism — a minor third-party-request consideration for the docs site only, which the author explicitly flags and offers to self-host if maintainers prefer.

Level of scrutiny

Low. This is a docs-presentation change with zero effect on the SDK's runtime behavior, API surface, or release artifacts. The riskiest element is the mkdocs-material<10 cap, which is confined to the docs dependency group, is justified by an inline comment (the CSS relies on Material-internal nav selectors), and can be trivially reverted. mkdocs.yml has strict: true, so a misconfigured theme option would fail the docs build in CI rather than silently degrading.

Other factors

The description is thorough about what was verified on a served build (instant navigation, pruning, dark mode, mobile drawer, search), and mkdocs build --strict is reported green. The bug hunting system found no issues, and the visual outcome itself is easiest to judge from the Cloudflare preview rather than code review. Purely aesthetic preferences (font choice, dark-header color) remain a maintainer call, but nothing here needs line-by-line human scrutiny for correctness.

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