Skip to content

fix(layer): scope UI variant defaults to docus components - #1395

Merged
larbish merged 2 commits into
mainfrom
fix/layer-ui-variant-defaults
Jun 17, 2026
Merged

fix(layer): scope UI variant defaults to docus components#1395
larbish merged 2 commits into
mainfrom
fix/layer-ui-variant-defaults

Conversation

@benjamincanac

Copy link
Copy Markdown
Collaborator

Summary

  • Remove global defaultVariants from the layer's app.config.ts so that overriding a Nuxt UI component (e.g. a custom AppHeaderCenter with a NavigationMenu) no longer inherits forced highlight/variant styles. Previously highlight: true caused an unwanted bottom border on overridden components.
  • Move those defaults into explicit ?? ... fallbacks inside the Docus components themselves (contentNavigation, navigationMenu, contentToc), keeping the default look unchanged while no longer leaking onto user overrides.
  • Limit the mobile header body navigation (AppHeaderBody) to first-level sections when navigation.sub is set, since deeper levels are already handled by the per-section drawer in DocsAsideMobileBar. Each top-level item links to its first page via the shared getFirstPagePath helper.
  • Fix a type error in useUIConfig when accessing defaultVariants on the merged app config.
  • Minor styling tweaks: command palette leading icon size, mobile bar trigger buttons.

Test plan

  • Override AppHeaderCenter with a custom NavigationMenu and confirm there's no forced bottom border / highlight.
  • With navigation.sub set, confirm the mobile hamburger menu shows only top-level sections, each linking to its first page.
  • Confirm default Docus navigation/toc highlight and variants are visually unchanged.

Remove global `defaultVariants` from app config so overriding Nuxt UI
components (e.g. a custom `AppHeaderCenter` with a `NavigationMenu`) no
longer inherit forced `highlight`/`variant` styles. Defaults now live as
explicit fallbacks in the Docus components themselves.

Also limit the mobile header body navigation to first-level sections when
`navigation.sub` is set, since deeper levels are handled by the per-section
drawer.
@vercel

vercel Bot commented Jun 16, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
docus Ready Ready Preview Jun 16, 2026 9:30am

@pkg-pr-new

pkg-pr-new Bot commented Jun 16, 2026

Copy link
Copy Markdown

Open in StackBlitz

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

commit: 82eb464

@larbish
larbish merged commit 82abeca into main Jun 17, 2026
4 checks passed
@larbish
larbish deleted the fix/layer-ui-variant-defaults branch June 17, 2026 09:04
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.

3 participants