Skip to content

Commit

Permalink
fix(ally): clear up confusion with the title of theme switch (#3215)
Browse files Browse the repository at this point in the history
Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>
  • Loading branch information
zh-lx and brc-dd committed Nov 17, 2023
1 parent 239d150 commit 6761036
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/client/theme-default/components/VPSwitchAppearance.vue
@@ -1,5 +1,5 @@
<script lang="ts" setup>
import { inject } from 'vue'
import { inject, computed } from 'vue'
import { useData } from '../composables/data'
import VPSwitch from './VPSwitch.vue'
import VPIconMoon from './icons/VPIconMoon.vue'
Expand All @@ -10,11 +10,15 @@ const { isDark } = useData()
const toggleAppearance = inject('toggle-appearance', () => {
isDark.value = !isDark.value
})
const switchTitle = computed(() => {
return isDark.value ? 'Switch to light theme' : 'Switch to dark theme'
})
</script>

<template>
<VPSwitch
title="toggle dark mode"
:title="switchTitle"
class="VPSwitchAppearance"
:aria-checked="isDark"
@click="toggleAppearance"
Expand Down

0 comments on commit 6761036

Please sign in to comment.