1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
//! Blinc Theme System
//!
//! A comprehensive theming system with design tokens, platform-native themes,
//! and system dark/light mode detection.
//!
//! # Overview
//!
//! The theme system provides:
//! - **Design tokens**: Colors, typography, spacing, radii, shadows, animations
//! - **Platform themes**: Native look and feel for macOS, Windows, Linux, iOS, Android
//! - **Color scheme detection**: Automatic detection of system dark/light mode
//! - **Dynamic overrides**: Runtime customization without layout rebuilds
//!
//! # Quick Start
//!
//! ```rust,ignore
//! use blinc_theme::{ThemeState, ColorToken};
//!
//! // Initialize theme at app startup
//! ThemeState::init_default();
//!
//! // Access theme in widgets
//! let theme = ThemeState::get();
//! let primary_color = theme.color(ColorToken::Primary);
//! let spacing = theme.spacing();
//! ```
//!
//! # Architecture
//!
//! The theme system is designed to minimize UI rebuilds:
//!
//! - **Visual tokens** (colors, shadows): Changes trigger repaint only
//! - **Layout tokens** (spacing, typography): Changes trigger partial layout
//!
//! # Tokens
//!
//! Tokens are the atomic values that make up the design system:
//!
//! - [`ColorTokens`]: Semantic colors (primary, error, background, text, etc.)
//! - [`TypographyTokens`]: Font families, sizes, weights, line heights
//! - [`SpacingTokens`]: 4px-based spacing scale
//! - [`RadiusTokens`]: Border radii
//! - [`ShadowTokens`]: Box shadows
//! - [`AnimationTokens`]: Durations and easings
//!
//! # Themes
//!
//! Built-in themes:
//!
//! - [`BlincTheme`]: Default theme derived from Catppuccin design system
//! - Platform-specific themes for macOS, Windows, Linux, iOS, Android
//!
//! # Dynamic Overrides
//!
//! Override tokens at runtime without full rebuilds:
//!
//! ```rust,ignore
//! let theme = ThemeState::get();
//!
//! // Override a color (repaint only, no layout)
//! theme.set_color_override(ColorToken::Primary, Color::from_hex(0xFF5500));
//!
//! // Override spacing (triggers partial layout)
//! theme.set_spacing_override(SpacingToken::Space4, 20.0);
//!
//! // Clear all overrides
//! theme.clear_overrides();
//! ```
// Re-export commonly used types
pub use ;
pub use ;
pub use ;
pub use ;
pub use *;
pub use ;