Skip to content

Commit 3d59003

Browse files
committed
docs(theme): improve selector UX
- Show current theme name in toggle title - Fix copy button title to say Vuetify0 - Add margin-top to popover content
1 parent 84df875 commit 3d59003

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

apps/docs/src/components/app/AppThemeSelector.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// Themes
1313
import type { ThemeId } from '@/themes'
1414
15-
const { icon, preference, setPreference } = useThemeToggle()
15+
const { icon, title, preference, setPreference } = useThemeToggle()
1616
1717
const isOpen = ref(false)
1818
@@ -50,13 +50,13 @@
5050
<Popover.Activator
5151
aria-label="Select theme"
5252
class="bg-surface-tint text-on-surface-tint pa-1 inline-flex rounded hover:bg-surface-variant transition-all cursor-pointer"
53-
title="Select theme"
53+
:title="title"
5454
>
5555
<AppIcon :icon />
5656
</Popover.Activator>
5757

5858
<Popover.Content
59-
class="p-3 rounded-lg bg-surface border border-divider shadow-xl min-w-56"
59+
class="p-3 rounded-lg bg-surface border border-divider shadow-xl min-w-56 !mt-1"
6060
position-area="bottom span-left"
6161
position-try="bottom span-left, bottom span-right, top span-left, top span-right"
6262
>

apps/docs/src/components/app/settings/AppSettingsTheme.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
<span>Theme</span>
5353
<button
5454
class="ml-auto p-1 rounded hover:bg-surface-tint transition-colors inline-flex items-center justify-center shrink-0"
55-
title="Copy current theme as Vuetify config"
55+
title="Copy theme as Vuetify0 config"
5656
type="button"
5757
@click="exportTheme"
5858
>

apps/docs/src/composables/useThemeToggle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export function useThemeToggle (): UseThemeToggleReturn {
9292
}
9393

9494
const icon = toRef(() => PREFERENCE_ICONS[preference.value] ?? 'theme-system')
95-
const title = toRef(() => `Toggle Theme (${PREFERENCE_LABELS[preference.value] ?? 'System'})`)
95+
const title = toRef(() => `Theme: ${PREFERENCE_LABELS[preference.value] ?? 'System'}`)
9696

9797
function toggle () {
9898
const currentIndex = PREFERENCE_ORDER.indexOf(preference.value)

0 commit comments

Comments
 (0)