You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
528 B
22 lines
528 B
<template>
|
|
<button class="theme-toggle" @click="toggleTheme" :aria-label="TEXTS.THEME.TOGGLE_LABEL">
|
|
<span class="theme-icon">{{ themeIsDark ? '🌞' : '🌙' }}</span>
|
|
</button>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { TEXTS } from '../config/content';
|
|
import { computed } from 'vue';
|
|
|
|
const { $theme } = useNuxtApp();
|
|
|
|
const themeIsDark = computed(() => $theme.isDark);
|
|
|
|
const toggleTheme = () => {
|
|
$theme.toggleTheme();
|
|
};
|
|
</script>
|
|
|
|
<style scoped>
|
|
@import '~/assets/css/components/theme-toggle.css';
|
|
</style> |