+
+
emit('theme',theme)">
Found a bug?
Privacy Policy
diff --git a/Frontend/src/components/sidebar/SidebarComponent.vue b/Frontend/src/components/sidebar/SidebarComponent.vue
index 51a28c4..afca887 100644
--- a/Frontend/src/components/sidebar/SidebarComponent.vue
+++ b/Frontend/src/components/sidebar/SidebarComponent.vue
@@ -8,13 +8,32 @@ import logoWhite from '@assets/logo_czarne.svg';
const logoR11 = ref( logoDark );
+const emit = defineEmits([
+ 'theme:changed'
+])
+
function changeLogoForTheme(){
logoR11.value = isDarkModeSet() ? logoDark : logoWhite;
}
function isDarkModeSet(){
- return window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
+ return localStorage.theme == "dark";
+}
+
+function changeTheme(theme:string){
+ switch (theme){
+ case "dark":{
+ changeLogoForTheme()
+ emit('theme:changed',theme);
+ break;
+ }
+ case "light":{
+ changeLogoForTheme()
+ emit('theme:changed',theme);
+ break;
+ }
+ }
}
onMounted( () => {
@@ -55,7 +74,7 @@ onMounted( () => {
-
+
\ No newline at end of file
diff --git a/Frontend/tailwind.config.js b/Frontend/tailwind.config.js
index 102b33c..529389e 100644
--- a/Frontend/tailwind.config.js
+++ b/Frontend/tailwind.config.js
@@ -11,5 +11,6 @@ export default {
'mono': ["Sono"],
}
},
+ darkMode: 'class',
plugins: [],
}
\ No newline at end of file