28 lines
788 B
Plaintext
28 lines
788 B
Plaintext
// Theme Manager
|
|
// Global theme state with light/dark mode support
|
|
|
|
import { ColorPalette, LightColors, DarkColors } from "colors.slint";
|
|
import { Typography } from "typography.slint";
|
|
import { SpacingSystem } from "spacing.slint";
|
|
import { Animations } from "../utils/animations.slint";
|
|
|
|
// Global theme manager (singleton)
|
|
export global Theme {
|
|
// Theme state
|
|
in-out property <bool> is-dark-mode: false;
|
|
|
|
// Current active color palette (reactive)
|
|
out property <ColorPalette> colors: is-dark-mode ?
|
|
DarkColors.palette : LightColors.palette;
|
|
|
|
// Theme toggle callback
|
|
callback toggle-theme();
|
|
|
|
toggle-theme => {
|
|
is-dark-mode = !is-dark-mode;
|
|
}
|
|
}
|
|
|
|
// Re-export for convenience
|
|
export { Typography, SpacingSystem, Animations }
|