fix(docs): use native header control composition and default sizing
This commit is contained in:
@@ -28,6 +28,7 @@ function setTheme(value: unknown) {
|
||||
<template>
|
||||
<ToggleButtonGroup
|
||||
class="docs-theme-wide"
|
||||
is-detached
|
||||
:model-value="mode"
|
||||
selection-mode="single"
|
||||
disallow-empty-selection
|
||||
@@ -40,6 +41,7 @@ function setTheme(value: unknown) {
|
||||
:id="choice.id"
|
||||
:key="choice.id"
|
||||
is-icon-only
|
||||
variant="ghost"
|
||||
:aria-label="choice.label"
|
||||
>
|
||||
<component :is="choice.icon" aria-hidden="true" :size="15" />
|
||||
@@ -63,6 +65,7 @@ function setTheme(value: unknown) {
|
||||
<PopoverDialog>
|
||||
<PopoverHeading class="sr-only">外观</PopoverHeading>
|
||||
<ToggleButtonGroup
|
||||
is-detached
|
||||
:model-value="mode"
|
||||
selection-mode="single"
|
||||
disallow-empty-selection
|
||||
@@ -75,6 +78,7 @@ function setTheme(value: unknown) {
|
||||
:id="choice.id"
|
||||
:key="choice.id"
|
||||
is-icon-only
|
||||
variant="ghost"
|
||||
:aria-label="choice.label"
|
||||
>
|
||||
<component :is="choice.icon" aria-hidden="true" :size="16" />
|
||||
|
||||
@@ -218,16 +218,9 @@ async function copyMarkdownCode(event: MouseEvent) {
|
||||
<Chip size="sm" variant="soft">Vue</Chip>
|
||||
</Link>
|
||||
<Popover>
|
||||
<PopoverTrigger as-child>
|
||||
<Button
|
||||
class="version"
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
aria-label="版本信息"
|
||||
>
|
||||
v0.0.1
|
||||
<IconChevronDown :size="12" aria-hidden="true" />
|
||||
</Button>
|
||||
<PopoverTrigger as="button" class="version" aria-label="版本信息">
|
||||
<span>v0.0.1</span>
|
||||
<IconChevronDown :size="14" aria-hidden="true" />
|
||||
</PopoverTrigger>
|
||||
<PopoverContent placement="bottom start">
|
||||
<PopoverDialog class="version-panel">
|
||||
@@ -248,15 +241,17 @@ async function copyMarkdownCode(event: MouseEvent) {
|
||||
</div>
|
||||
<DocSearch />
|
||||
<div class="nav-tools">
|
||||
<Link
|
||||
class="docs-github"
|
||||
href="https://git.myjdemo.cn/maoyingjie/heroui-vue"
|
||||
target="_blank"
|
||||
rel="noreferrer noopener"
|
||||
aria-label="项目源码"
|
||||
>
|
||||
<IconBrandGithub :size="19" aria-hidden="true" />
|
||||
</Link>
|
||||
<Button as-child variant="tertiary" size="sm" class="docs-github">
|
||||
<a
|
||||
href="https://git.myjdemo.cn/maoyingjie/heroui-vue"
|
||||
target="_blank"
|
||||
rel="noreferrer noopener"
|
||||
aria-label="项目源码"
|
||||
>
|
||||
<IconBrandGithub :size="16" aria-hidden="true" />
|
||||
<span>源码</span>
|
||||
</a>
|
||||
</Button>
|
||||
<DocsThemeSwitch />
|
||||
<Drawer v-model:open="mobile">
|
||||
<DrawerTrigger as-child>
|
||||
|
||||
@@ -65,11 +65,20 @@ html {
|
||||
font-size: 11px;
|
||||
}
|
||||
.docs-nav .version {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 6px;
|
||||
padding: 4px 0;
|
||||
height: auto;
|
||||
min-width: 0;
|
||||
background: transparent;
|
||||
border: 0;
|
||||
color: var(--muted);
|
||||
font-size: 12px;
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.docs-nav .version svg {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.version-panel {
|
||||
display: flex;
|
||||
@@ -93,6 +102,7 @@ html {
|
||||
}
|
||||
.docs-github {
|
||||
color: var(--muted);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.docs-nav-sections {
|
||||
display: flex;
|
||||
@@ -129,24 +139,17 @@ html {
|
||||
}
|
||||
.docs-theme-wide {
|
||||
padding: 2px;
|
||||
border-radius: 14px;
|
||||
border-radius: 999px;
|
||||
background: var(--default);
|
||||
gap: 0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.docs-theme-wide .hv-toggle-button {
|
||||
min-width: 28px;
|
||||
width: 28px;
|
||||
height: 26px;
|
||||
border: 0;
|
||||
border-radius: 12px;
|
||||
padding: 4px;
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
color: var(--muted);
|
||||
--toggle-button-bg-selected: var(--surface);
|
||||
--toggle-button-bg-selected-hover: var(--surface);
|
||||
--toggle-button-bg-selected-pressed: var(--surface);
|
||||
--toggle-button-fg-selected: var(--foreground);
|
||||
}
|
||||
.docs-theme-wide .hv-toggle-button[data-selected="true"] {
|
||||
background: var(--surface);
|
||||
color: var(--foreground);
|
||||
box-shadow: var(--surface-shadow);
|
||||
}
|
||||
.docs-theme-compact,
|
||||
@@ -673,7 +676,7 @@ html {
|
||||
.docs-sidebar {
|
||||
grid-row: 1 / span 2;
|
||||
}
|
||||
.version {
|
||||
.docs-nav .version {
|
||||
display: none;
|
||||
}
|
||||
.docs-nav-main {
|
||||
|
||||
Reference in New Issue
Block a user