Implement dark theme colors

This commit is contained in:
Riyyi
2025-04-03 00:00:03 +02:00
parent 6d89d2bd70
commit fb261625ff
7 changed files with 31 additions and 10 deletions
+9
View File
@@ -10,7 +10,16 @@ export const useStateStore = defineStore("state", () => {
const toggleColorMode = (): void => {
colorMode.value = colorMode.value === "dark" ? "light" : "dark";
const html = document.querySelector("html") as HTMLElement;
// Theme used by Bootstrap
html.setAttribute('data-bs-theme', colorMode.value);
// Theme class used by shiki syntax highlighting
if (colorMode.value === "dark") {
html.classList.add("dark");
} else {
html.classList.remove("dark");
}
};
const popoverList = ref<any[]>([]);