From 9802f35e844876d2ceaee5e84f31ae679cdb94eb Mon Sep 17 00:00:00 2001 From: Serhii Bedrytskyi Date: Tue, 23 May 2023 18:32:27 +0300 Subject: [PATCH] docs: AppHeader --- .../content/3.components/3.app/1.header.md | 123 +++++++++++++++++- components/app/AppHeader.vue | 17 ++- components/landing/SectionHeader.vue | 3 +- package.json | 2 +- 4 files changed, 132 insertions(+), 13 deletions(-) diff --git a/.starters/default/content/3.components/3.app/1.header.md b/.starters/default/content/3.components/3.app/1.header.md index 7b163ace0..c76799e3d 100644 --- a/.starters/default/content/3.components/3.app/1.header.md +++ b/.starters/default/content/3.components/3.app/1.header.md @@ -1 +1,122 @@ -# Header \ No newline at end of file +# Header + +App header component. Used inside [`AppLayout`](/components/layout/app-layout) component. + +It has several components, which renders depending on app configuration or context. Those components includes: `AppHeaderDrawer`, `AppHeaderLogo`, `AppNavigation`, `AppSearch`, `AppTextDirection`, `AppColorMode`, `AppSocialIcons`. + +::callout +This is not a MDC component, but you can control it's visibility with configuration or front-matter (WIP 🚧). +:: + +## Configuration + +```ts [app.config.ts] +export default defineAppConfig({ + docus: { + header: { + title: '', + logo: false, + showLinkIcon: false, + fluid: false, + exclude: [] + }, + } +}) +``` + +## Design Tokens + +```ts [tokens.config.ts] +import { defineTheme } from 'pinceau' + +export default defineTheme({ + docus: { + header: { + height: '64px', + logo: { + height: { + initial: '{space.6}', + sm: '{space.7}' + } + }, + backdropFilter: '{elements.backdrop.filter}', + backgroundColor: '{elements.backdrop.background}', + borderBottomWidth: '1px', + borderBottomStyle: 'solid', + borderBottomColor: '{elements.border.primary.static}', + title: { + fontSize: '{fontSize.2xl}', + fontWeight: '{fontWeight.bold}', + color: { + static: { + initial: '{color.gray.900}', + dark: '{color.gray.100}' + }, + hover: '{color.primary.500}' + } + }, + icon: { + size: '{space.4}' + }, + layout: { + gridTemplateColumns: 'repeat(12, minmax(0, 1fr))', + gap: '{space.2}', + left: { + gridColumn: 'span 4 / span 4' + }, + center: { + gridColumn: 'span 4 / span 4' + }, + right: { + gridColumn: 'span 4 / span 4' + } + }, + drawer: { + button: { + color: { + static: { + initial: '{color.gray.500}', + dark: '{color.gray.400}' + }, + hover: { + initial: '{color.gray.700}', + dark: '{color.gray.200}' + } + }, + zIndex: '10', + padding: '{space.4}', + paddingInlineStart: '0px' + }, + menu: { + borderRightWidth: '1px', + borderRightStyle: 'solid', + borderRightColor: '{elements.border.primary.static}', + backgroundColor: { + initial: '{color.gray.50}', + dark: '{color.gray.900}' + }, + paddingX: { + initial: '{space.4}', + sm: '{space.6}' + }, + header: { + height: '{docus.app.header.height}', + alignItems: 'center', + justifyContent: 'space-between', + borderBottomWidth: '1px', + borderBottomStyle: 'solid', + borderBottomColor: '{elements.border.primary.static}', + gap: '{space.2}', + icon: { + size: '{space.4}' + } + }, + links: { + paddingTop: '{space.6}' + } + } + } + }, + } +}) +``` \ No newline at end of file diff --git a/components/app/AppHeader.vue b/components/app/AppHeader.vue index 5eb28eb87..185d156d8 100644 --- a/components/app/AppHeader.vue +++ b/components/app/AppHeader.vue @@ -7,10 +7,6 @@ const route = useRoute() const hasDrawer = computed(() => navigation.value?.length > 1 || navigation.value?.[0]?.children?.length) -defineProps({ - ...variants -}) - const isIndex = computed(() => route.path === '/') watch(isIndex, (value) => { @@ -34,7 +30,7 @@ watch(isIndex, (value) => {
- +
@@ -69,10 +65,13 @@ css({ }, '.center &': { - display: 'block', - '@lg': { - display: 'none' - } + display: 'none', + '.has-drawer &': { + display: 'block', + '@lg': { + display: 'none' + }, + }, } }, diff --git a/components/landing/SectionHeader.vue b/components/landing/SectionHeader.vue index 609f01cf2..0a4db72af 100644 --- a/components/landing/SectionHeader.vue +++ b/components/landing/SectionHeader.vue @@ -10,8 +10,7 @@ defineProps({ }, title: { type: String, - default: '', - required: true + default: '' }, description: { type: String, diff --git a/package.json b/package.json index 57af8f360..68a06fd77 100644 --- a/package.json +++ b/package.json @@ -78,6 +78,6 @@ } }, "resolutions": { - "@nuxt-themes/tokens": "file:/Users/yaelguilloux/Code/nuxt/tokens" + "@nuxt-themes/tokens": "file:/Users/serhii/code/github/nuxt-themes/tokens" } }