From 24c65e61c4f6ad629ffea02c14799af0513713ea Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Tue, 16 Jun 2026 11:23:14 +0200 Subject: [PATCH 1/2] fix(layer): scope UI variant defaults to docus components 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. --- layer/app/app.config.ts | 23 ++++++------------- layer/app/components/app/AppHeaderBody.vue | 17 ++++++++++++-- layer/app/components/app/AppHeaderCenter.vue | 2 +- .../app/components/docs/DocsAsideLeftBody.vue | 1 + .../components/docs/DocsAsideMobileBar.vue | 10 ++++---- layer/app/components/docs/DocsAsideRight.vue | 2 +- layer/app/composables/useSubNavigation.ts | 2 +- layer/app/composables/useUIConfig.ts | 2 +- 8 files changed, 32 insertions(+), 27 deletions(-) diff --git a/layer/app/app.config.ts b/layer/app/app.config.ts index 825c1881f..3e72220c3 100644 --- a/layer/app/app.config.ts +++ b/layer/app/app.config.ts @@ -15,29 +15,20 @@ export default defineAppConfig({ slots: { item: 'items-center', input: '[&_.iconify]:size-4 [&_.iconify]:mx-0.5', - itemLeadingIcon: 'size-4 mx-0.5', }, - }, - contentToc: { - defaultVariants: { - highlightVariant: 'circuit', + variants: { + size: { + md: { + itemLeadingIcon: 'size-4 mx-0.5', + }, + }, }, }, contentNavigation: { slots: { - linkLeadingIcon: 'size-4 mr-1', + linkLeadingIcon: 'size-4 mx-0.5', linkTrailing: 'hidden', }, - defaultVariants: { - variant: 'link', - highlight: true, - }, - }, - navigationMenu: { - defaultVariants: { - variant: 'pill', - highlight: true, - }, }, pageLinks: { slots: { diff --git a/layer/app/components/app/AppHeaderBody.vue b/layer/app/components/app/AppHeaderBody.vue index f530fb9ba..21c507c19 100644 --- a/layer/app/components/app/AppHeaderBody.vue +++ b/layer/app/components/app/AppHeaderBody.vue @@ -1,17 +1,30 @@ diff --git a/layer/app/components/app/AppHeaderCenter.vue b/layer/app/components/app/AppHeaderCenter.vue index 6a7f4d415..65155bfee 100644 --- a/layer/app/components/app/AppHeaderCenter.vue +++ b/layer/app/components/app/AppHeaderCenter.vue @@ -4,7 +4,7 @@ class="w-full" variant="soft" :ui="{ - leadingIcon: 'size-4 mr-1', + leadingIcon: 'size-4 mx-0.5', }" /> diff --git a/layer/app/components/docs/DocsAsideLeftBody.vue b/layer/app/components/docs/DocsAsideLeftBody.vue index 96507c98b..2bde7cf89 100644 --- a/layer/app/components/docs/DocsAsideLeftBody.vue +++ b/layer/app/components/docs/DocsAsideLeftBody.vue @@ -6,6 +6,7 @@ const contentNavVariants = useUIConfig('contentNavigation')