Make the default theme responsive (stack sidebar on narrow screens)
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- css, javascript
- Domain
- documentation, frontend
Research direction
Start with src/default_theme/assets/style.css and inspect the Split.js setup in src/default_theme/assets/site.js alongside the pane markup in src/default_theme/index._. Run documentation build index.js -f html -o docs/api, then check the generated page at desktop and 375px widths; done means usable stacked panes on narrow screens while preserving the two-pane desktop layout.
Written by the indexing model from the issue text.
Description
Make the default theme responsive (stack sidebar on narrow screens)
Summary
The default theme (src/default_theme) is not responsive on narrow screens. A viewport meta tag is present (index._ line 7), but the layout relies on Split.js which hard-codes a two-pane split via inline styles, and there are no mobile media queries to collapse it.
Reproduction
- Run
documentation build index.js -f html -o docs/apion any project. - Open
docs/api/index.htmlin a browser and narrow the window to phone width (e.g. 375px), or open it from a phone.
The TOC (#split-left) stays fixed at ~33% of the width and the content (#split-right) at ~67%. Neither is usable: the sidebar squeezes the content and there is no way to hide/collapse it.
Root cause
src/default_theme/index._renders:<div id='split-left' class='overflow-auto fs0 height-viewport-100'>(line 16)<div id='split-right' class='relative overflow-auto height-viewport-100'>(line 99)
src/default_theme/assets/site.jsinitializes Split.js withsizes: [33, 67]and sets inlineflex-basis: calc(<size>% - 20px)on both panes (lines 116–129). These inline styles beat any stylesheet, and Split.js does not re-layout on small viewports.src/default_theme/assets/style.csscontains only a@media (min-width: 52em)block forfix-margin-3; there is no@media (max-width: …)rule at all.
The two panes also get height: 100vh (.height-viewport-100), so on mobile the page scrolls inside the panes instead of naturally.
Suggested fix
Make the default theme responsive out of the box:
- Add an
@media (max-width: ~50em)block insrc/default_theme/assets/style.cssthat:- switches the
.flexwrapper toflex-wrap: wrap; - sets
#split-leftand#split-righttoflex-basis: 100% !important(to override Split.js inline styles),height: auto,overflow: visible; - hides the
.gutter.gutter-horizontaldivider.
- switches the
- (Optional, nicer) Turn the TOC into a collapsible drawer / hamburger menu on narrow screens.
This is a ~30-line CSS-only change and keeps the same generated docs working on both desktop and mobile. I have verified a CSS-only variant of this approach locally: the same generated index.html renders correctly as a two-pane layout on desktop and as stacked single-column (TOC above content) on a phone.
Environment
- documentation 14.0.3
- Reproducible on the default theme both when built from source and via the bundled theme.
Related
- #50 “Mobile styles” (closed as not planned in 2015; the request is still unresolved): hamburger menu and responsive layout were never implemented.
- Dominant language
- JavaScript
- Stars
- 5.8k
- Forks
- 481
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from documentationjs/documentation
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
documentationjs/documentation#1666 · 2 comments ·
-
Fix outdated deps Open
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
documentationjs/documentation#1646 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
documentationjs/documentation#1644 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
documentationjs/documentation#1643 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
documentationjs/documentation#1642 · 1 comment ·
All issues in documentationjs/documentation
Similar issues
-
bot:ai-assisted component:compact-js status:untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
midnightntwrk/midnight-sdk#403 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 1/5 1-3 hours Newbie friendliness 86/100
DavidAnson/markdownlint-cli2#940 ·
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
githubnext/gh-aw-workshop#3692 ·
-
agent/guide documentation hive/hosted-available-lke648397-260827-5n31
Difficulty 2/5 1-3 hours Newbie friendliness 90/100