Skip to content

fix(layer): keep sub-navigation header height on error page - #1475

Merged
larbish merged 1 commit into
nuxt-content:mainfrom
userstoriesbot-showcase:fix/error-page-sub-header
Nov 13, 2026
Merged

larbish merged 1 commit into
nuxt-content:mainfrom
userstoriesbot-showcase:fix/error-page-sub-header

Conversation

@shkomg

@shkomg shkomg commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Fixes #1438

With navigation.sub: 'header', a missing page under an existing section rendered the error page with the two-row header squeezed into 64px, because error.vue lacked the docus-sub-header wrapper class that app.vue sets.

  • error.vue calls useSubNavigation(navigation) and adds the same docus-sub-header class to its wrapper, so the variable sits on the common ancestor of the header and the error content, like in app.vue.
  • The @media (min-width: 1024px) { .docus-sub-header { --ui-header-height: 112px } } rule moved from the <style> block in app.vue into the layer's docus.css template, so it also applies when only the error template renders.

Checked in the playground with navigation.sub: 'header' at 1280px: /docs/getting-started/does-not-exist now has a 112px header (64px before), on direct load and after client-side navigation; normal docs pages are unchanged at 112px, and below 1024px the header stays 64px. ESLint on the changed files, typecheck and unit tests pass.

Before After
before after
before, header zoomed 3x after, header zoomed 3x

The video shows the playground with the header tab bar enabled, opening a missing page under Getting Started, where the error page header now matches the other pages.

docus.mp4

Fix written with Claude Code; video is an automated browser run of this branch recorded by User Stories Bot.

@vercel

vercel Bot commented Nov 3, 2026

Copy link
Copy Markdown

@shkomg is attempting to deploy a commit to the NuxtLabs Team on Vercel.

A member of the Team first needs to authorize it.

@vercel

vercel Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docus Ready Ready Preview Nov 13, 2026 2:25pm UTC

@pkg-pr-new

pkg-pr-new Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/create-docus@1475
npm i https://pkg.pr.new/docus@1475

commit: 12fa1fd

@docus-bundle-report

Copy link
Copy Markdown

Production bundle

Comparing 2a9009e2 with ce896f2f. Compressed sizes are calculated from the emitted production assets.

Initial page load

Page Base JS (Brotli) PR JS (Brotli) Δ JS Δ CSS Δ files
/en 499.9 KiB 499.8 KiB -41 B (-0.0%) -27 B (-0.1%) —
/en/getting-started/installation 278.8 KiB 278.8 KiB -31 B (-0.0%) -27 B (-0.1%) —
/en/essentials/components 293.2 KiB 293.2 KiB -31 B (-0.0%) -27 B (-0.1%) —

Entry script, modulepreload chunks and stylesheets referenced by the prerendered HTML. Lazy and prefetched chunks are excluded.

All client assets

Metric Base (Brotli) PR (Brotli) Δ Brotli Δ gzip
Client JavaScript 848.1 KiB 848.0 KiB -107 B (-0.0%) -11 B (-0.0%)
Client CSS 25.3 KiB 25.3 KiB -27 B (-0.1%) -1 B (-0.0%)
Other client assets 339.4 KiB 339.4 KiB -1 B (-0.0%) -1 B (-0.0%)
Total client assets 1.18 MiB 1.18 MiB -135 B (-0.0%) -13 B (-0.0%)

Largest module increases

Module Base (Brotli) PR (Brotli) Δ Brotli
layer/app/error.vue?vue&type=script&setup=true&lang.ts 1.1 KiB 1.1 KiB +29 B (+2.6%)
layer/app/components/IconMenuToggle.vue?vue&type=script&setup=true&lang.ts 694 B 695 B +1 B (+0.1%)

Module values come from Nuxt’s analyzer and are attribution estimates. This workflow is currently report-only.

Workflow run

@larbish

larbish commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

Thanks @shkomg, can you please sign your commit so I can merge this?

error.vue now sets the docus-sub-header class like app.vue, and the
112px header height rule moved into the layer global CSS so both
templates share it.
@shkomg
shkomg force-pushed the fix/error-page-sub-header branch from ce896f2 to 12fa1fd Compare November 10, 2026 23:27
@shkomg

shkomg commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

Done! Signed it, thanks @larbish

@larbish larbish closed this Nov 13, 2026
@larbish larbish reopened this Nov 13, 2026
@larbish
larbish merged commit 8b01e85 into nuxt-content:main Nov 13, 2026
12 checks passed

This branch was successfully deployed

1 active deployment
Preview — 12fa1fd2 Deployed Nov 13, 2026 by vercel[bot]
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.

Error page header collapses to 64px when navigation.sub is 'header'

2 participants