Skip to content

docs: make the docs site theme usable on mobile and narrow screens#7853

Merged
prrao87 merged 2 commits into
mainfrom
xuanwo/docs-mobile-responsive-de9db4
Jul 20, 2026
Merged

docs: make the docs site theme usable on mobile and narrow screens#7853
prrao87 merged 2 commits into
mainfrom
xuanwo/docs-mobile-responsive-de9db4

Conversation

@Xuanwo

@Xuanwo Xuanwo commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator
image

Why

The custom "Lance Docs" theme introduced in #7821 was designed desktop-first: on phones and narrow windows the header overflows horizontally (the section tabs get squeezed to zero width while the non-shrinking action buttons push the page wider than the viewport), and the side navigation renders as a long static block above every article, forcing readers to scroll past the whole section index before reaching content.

This makes the theme responsive:

  • Below 960px the header folds into two rows: brand plus icon-only actions on top ("Get started", the GitHub label, and the star count collapse away), with a horizontally scrollable section-tab row underneath.
  • The side navigation collapses behind a disclosure button labeled with the current section, so articles lead on mobile.
  • Anchor jumps now land clear of the sticky header (scroll-margin-top), the search overlay becomes an edge-to-edge sheet on small screens, and article headings, the footer, and the 404 page scale down.

Verified in a real browser at 390px and 320px widths (home, docs pages, tables, code blocks, dark mode, search) and regression-checked the desktop layout, which is unchanged.

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: QUIET

Plan: Pro Plus

Run ID: 039b30a2-6a45-404d-8949-308f698a2b4f

📥 Commits

Reviewing files that changed from the base of the PR and between e934cc2 and 2999c28.

📒 Files selected for processing (5)
  • docs/theme/assets/site.css
  • docs/theme/assets/site.js
  • docs/theme/base.html
  • docs/theme/home.html
  • docs/theme/main.html

📝 Walkthrough

Walkthrough

The documentation theme adds a responsive sidenav toggle, updates header and sidebar markup, adjusts folded-layout behavior, and refines hero, heading-anchor, and mobile search styling.

Changes

Responsive documentation theme

Layer / File(s) Summary
Sidenav disclosure wiring
docs/theme/main.html, docs/theme/assets/site.js, docs/theme/assets/site.css
Adds an accessible menu button, synchronizes its expanded state with the sidenav’s open class, and styles the collapsed responsive navigation panel.
Responsive theme layout details
docs/theme/home.html, docs/theme/base.html, docs/theme/assets/site.css
Structures hero and GitHub labels for responsive styling, adjusts heading scroll offsets, folds header controls below 960px, and makes mobile search edge-to-edge below 700px.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Reader
  participant SidenavToggle
  participant SiteJS
  participant Sidenav
  Reader->>SidenavToggle: Click menu button
  SidenavToggle->>SiteJS: Invoke click handler
  SiteJS->>Sidenav: Toggle open class
  SiteJS->>SidenavToggle: Update aria-expanded
Loading

Possibly related PRs

  • lance-format/lance#7821: Related Lance MkDocs theme refinements covering responsive sidenav behavior and documentation theme markup.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: making the docs site theme usable on mobile and narrow screens.
Description check ✅ Passed The description matches the changeset and explains the responsive docs theme updates in relevant detail.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch xuanwo/docs-mobile-responsive-de9db4

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

@github-actions github-actions Bot added A-docs Documentation documentation Improvements or additions to documentation labels Jul 20, 2026
@prrao87
prrao87 marked this pull request as ready for review July 20, 2026 14:22

@prrao87 prrao87 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.

Tested on a small local window, looks good. Thanks for the fix!

@prrao87
prrao87 merged commit 0f6fd2e into main Jul 20, 2026
9 of 10 checks passed
@prrao87
prrao87 deleted the xuanwo/docs-mobile-responsive-de9db4 branch July 20, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-docs Documentation documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants