primefaces / sakai-vue

https://sakai.primevue.org
MIT License
652 stars 320 forks source link

[Question] How to set dark mode activate by default? #34

Closed jonaskahn closed 1 month ago

jonaskahn commented 1 month ago

Straight forward to my question, I want to setup darkmode is on by default. I already made it in V3 but in V4, the code changed a lot. Could developers help me? Thank you.

jonaskahn commented 1 month ago

Solved

bilal-the-dev commented 1 month ago

you didnt tell how to?

jonaskahn commented 1 month ago

Oh, sorry. I thought I was the only one. I added the line document.documentElement.classList.toggle('app-dark'); in App.vue

onBeforeMount(() => {
    document.documentElement.classList.toggle('app-dark');
});

If it does not work, change to onMounted().


Btw, I made an enhance version of sakai. enhanced-sakai There is a feature that the app configuration stores setting to the local storage, therefore we can keep the theme settings even F5 hit.

bilal-the-dev commented 1 month ago

cool, its working , do you know when we change the default settings of this sakai vue , it does not work i want to change the default setting, right now primary color is always emrald, i want to change that intonoir ,and also want to change the surface togray. any way Thanks