update
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// App.js
|
||||
import { $, watch, h, when } from "./sigpro.js";
|
||||
import { $, watch, h, when } from "sigpro";
|
||||
import {
|
||||
Navbar,
|
||||
Drawer,
|
||||
@@ -22,19 +22,19 @@ import {
|
||||
Fieldset,
|
||||
Input,
|
||||
Button
|
||||
} from "./sigpro-ui.js";
|
||||
import './sigpro-ui.css';
|
||||
} from "sigpro-ui";
|
||||
import 'sigpro-ui/css';
|
||||
|
||||
import { Desktop } from "./tabs/Desktop.js";
|
||||
export const isDark = $(false, "theme-mode");
|
||||
|
||||
|
||||
export const App = () => {
|
||||
// Tema oscuro/claro
|
||||
const isDark = $(localStorage.getItem("theme") === "dark"
|
||||
|| (!localStorage.getItem("theme") && window.matchMedia("(prefers-color-scheme: dark)").matches));
|
||||
|
||||
|
||||
// Sincronizar el tema con el atributo data-theme del HTML
|
||||
watch(isDark, (dark) => {
|
||||
const theme = dark ? "dark" : "light";
|
||||
document.documentElement.setAttribute("data-theme", theme);
|
||||
localStorage.setItem("theme", theme);
|
||||
document.documentElement.setAttribute("data-theme", dark ? "dark" : "light");
|
||||
});
|
||||
|
||||
// Activar tema inicial
|
||||
@@ -57,7 +57,7 @@ export const App = () => {
|
||||
const tabs = $([
|
||||
{
|
||||
label: "Escritorio",
|
||||
content: () => `¡Bienvenido al escritorio!`,
|
||||
content: () => Desktop,
|
||||
closable: false
|
||||
}
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user