dopo molte richieste, condivido un componente per il cambio tema, isolato dal mio Tema Alien Night.
Per ora, una volta premuto il pulsante, il tuo tema verrà commutato in un tema a modalità scura.
In futuro potrei implementare una pagina delle impostazioni dove potrai definire la tua classe CSS globale a cui il tema dovrebbe commutarsi.
Oppure semplicemente alternare tra i primi due temi che hai consentito agli utenti di scegliere…
You can let admins select which themes they want to use. We have two different themes and each theme has it own dark mode.
When we click the switch to change light to dark, this component below should have change the logo’s color to light as the opposite. Now it doesn’t work with this switch.
Defining the themes in the settings is possible, but will complicate things. The hamburger menu theme selector is a good working example of how you’d change the theme based on ID.
I had some time tonight, so I worked on modifying the hamburger theme selector to toggle between two themes: Header Theme Toggle. Thanks so much for inspiring this with your theme @B-iggy!
Not necessarily, there are some benefits of switching the CSS rather than switching the entire theme. Everything’s self contained and you don’t need to fully refresh for all the changes to take effect.
Instead of changing the code on your end I think it makes sense to have it next to the search icon per default.
So I pushed this change now. Let me know if it’s fine
Inoltre, esiste qualche soluzione per aggiungere un logo alternativo? Quello attuale non è leggibile su sfondo scuro, quindi vorrei aggiungerne uno invertito per la modalità scura.
Il mio tema ha molti colori hardcoded e funziona correttamente solo con un tema chiaro. Sono disponibile a risolvere il problema, ma per ora non funziona bene in modalità scura.
Hai qualche idea per rendere la parte inferiore più piccola? Quando si utilizza un componente aggiuntivo, occupa molto spazio nell’intestazione. Ad esempio, mi piace il pulsante per la modalità scura in questo tema Ghost in alto a destra: