init
This commit is contained in:
26
ui/theme/theme.slint
Normal file
26
ui/theme/theme.slint
Normal file
@@ -0,0 +1,26 @@
|
||||
// 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";
|
||||
|
||||
// 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 }
|
||||
Reference in New Issue
Block a user