feat: add theme selection functionality and update theme management in the application, including new themes and improved persistence handling
This commit is contained in:
@@ -111,8 +111,17 @@
|
||||
(function () {
|
||||
if (typeof document !== 'undefined') {
|
||||
var html = document.documentElement;
|
||||
if (!html.getAttribute('data-theme')) {
|
||||
html.setAttribute('data-theme', 'aqua');
|
||||
if (html && !html.getAttribute('data-theme')) {
|
||||
var tema = null;
|
||||
try {
|
||||
// theme-change usa por padrão a chave "theme"
|
||||
tema = localStorage.getItem('theme');
|
||||
} catch (e) {
|
||||
tema = null;
|
||||
}
|
||||
|
||||
// Fallback para o tema padrão se não houver persistência
|
||||
html.setAttribute('data-theme', tema || 'aqua');
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user