File tree Expand file tree Collapse file tree 3 files changed +28
-2
lines changed
src/client/theme-default/components Expand file tree Collapse file tree 3 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -406,6 +406,20 @@ export interface DocFooter {
406406
407407Can be used to customize the dark mode switch label. This label is only displayed in the mobile view.
408408
409+ ## lightModeSwitchTitle
410+
411+ - Type: ` string `
412+ - Default: ` Switch to light theme `
413+
414+ Can be used to customize the light mode switch title that appears on hovering.
415+
416+ ## darkModeSwitchTitle
417+
418+ - Type: ` string `
419+ - Default: ` Switch to dark theme `
420+
421+ Can be used to customize the dark mode switch title that appears on hovering.
422+
409423## sidebarMenuLabel
410424
411425- Type: ` string `
Original file line number Diff line number Diff line change @@ -5,14 +5,16 @@ import VPSwitch from './VPSwitch.vue'
55import VPIconMoon from ' ./icons/VPIconMoon.vue'
66import VPIconSun from ' ./icons/VPIconSun.vue'
77
8- const { isDark } = useData ()
8+ const { isDark, theme } = useData ()
99
1010const toggleAppearance = inject (' toggle-appearance' , () => {
1111 isDark .value = ! isDark .value
1212})
1313
1414const switchTitle = computed (() => {
15- return isDark .value ? ' Switch to light theme' : ' Switch to dark theme'
15+ return isDark .value
16+ ? theme .value .lightModeSwitchTitle || ' Switch to light theme'
17+ : theme .value .darkModeSwitchTitle || ' Switch to dark theme'
1618})
1719 </script >
1820
Original file line number Diff line number Diff line change @@ -96,6 +96,16 @@ export namespace DefaultTheme {
9696 */
9797 darkModeSwitchLabel ?: string
9898
99+ /**
100+ * @default 'Switch to light theme'
101+ */
102+ lightModeSwitchTitle ?: string
103+
104+ /**
105+ * @default 'Switch to dark theme'
106+ */
107+ darkModeSwitchTitle ?: string
108+
99109 /**
100110 * @default 'Menu'
101111 */
You can’t perform that action at this time.
0 commit comments