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
// SPDX-FileCopyrightText: Copyright (c) 2026 Mike Li/Mikewolfli/Wei Li(mikewolfli@163.com)
// SPDX-License-Identifier: MIT
//! Style system primitives.
//!
//! The style pipeline is layered so that a widget's appearance can be resolved
//! without any single source having to know about all the others:
//!
//! 1. [`primitives`](crate::style::primitives) — the value types (colour, padding,
//! margin, font) that the rest of the system is built from. No resolution logic.
//! 2. [`theme`](crate::style::theme) and [`theme_state`](crate::style::theme_state)
//! — the interaction-state model: which states a control can be in, and the
//! per-state appearance and light/dark preference that select a theme.
//! 3. [`selector`](crate::style::selector), [`css`](crate::style::css), and
//! [`stylesheet`](crate::style::stylesheet) — declarative matching. A selector
//! decides *whether* a rule applies to a widget, and CSS text is parsed into
//! those rules.
//! 4. [`gradient`](crate::style::gradient) and [`animation`](crate::style::animation)
//! / [`animation_group`](crate::style::animation_group) — appearance values that
//! vary over position and time rather than being constants.
//!
//! # Resolution order
//!
//! A widget's appearance is resolved by *merging* successive layers, each of which
//! only fills in what the layer before it left unset. The order is:
//!
//! 1. **Theme** — `crate::theme::resolved_theme_style`, the base palette, fonts and
//! metrics. This is the only layer that can supply a font.
//! 2. **Registered stylesheets** — `StyleSheetManager::apply_to`, app-wide CSS in
//! priority order.
//! 3. **Inline declarations** — a node's own CSS text (`Widget::apply_css`) and then
//! its explicit style keys.
//!
//! Each step is one call to `WidgetStyle::merge`, which cannot overwrite a value
//! an earlier (more specific) layer already set. `crate::json` performs exactly this
//! sequence; see `json::loader::apply_declared_styles`.
//!
//! # Reachability
//!
//! **State:** Production callers: `src/theme/mod.rs:1` (the theme resolves into `WidgetStyle`); 27 files reference it.
/// Time-varying style values: a styled property that is evaluated at a point in
/// time rather than being a constant.
/// Groups of animations advanced and driven as a unit, for coordinating several
/// timelines under one play/pause/seek call.
/// Poll-based CSS file watcher that reloads a stylesheet into the global
/// [`stylesheet::StyleSheetManager`] when the file changes.
/// Position-varying colour ramps, used where a constant colour would be a
/// special case of a gradient.
/// The base style value types — colour, padding, margin, border, font — that the
/// rest of the style system composes and resolves. Contains no matching or
/// inheritance logic, which lives in the layers above.
/// Per-widget interaction state used to select a style variant, so a control can
/// look different when hovered, pressed, focused, or disabled.
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
/// Serialises tests that touch the process-wide stylesheet manager.
pub use stylesheet_test_guard;
pub use *;
pub use *;
pub use *;