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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
//! euv_macros
//!
//! Procedural macros for the euv UI framework, including the `html!` macro
//! for declarative UI syntax, the `class!` macro for CSS class definitions,
//! the `css_vars!` macro for CSS custom properties, the `watch!` macro for
//! reactive side effects, and the `component` attribute macro.
pub use ;
use ;
/// The `html!` macro for writing declarative UI in euv.
///
/// This macro accepts a syntax similar to Dioxus HTML:
///
/// ```ignore
/// html! {
/// div {
/// class: c_container()
/// h1 { "Hello, euv!" }
/// button {
/// onclick: move |_| { /* handle click */ },
/// "Click me"
/// }
/// }
/// }
/// ```
/// The `class!` macro for defining CSS classes with style properties.
///
/// Each class definition creates a `CssClass` function that can be used
/// in `html!` via the `class:` attribute. Styles are automatically injected
/// into the DOM on first use.
///
/// ```ignore
/// class! {
/// pub container {
/// max_width: "800px";
/// margin: "0 auto";
/// }
/// pub(crate) header {
/// font_size: "28px";
/// }
/// hidden {
/// display: "none";
/// }
/// }
/// ```
/// The `watch!` macro for creating reactive side effects.
///
/// Watches one or more signals and executes a closure whenever any of them changes.
/// The closure is also executed once immediately with the current signal values
/// during initialisation. This initial execution is wrapped in a suppressed-update
/// scope so that any `.set()` calls inside the body do not trigger unnecessary
/// DynamicNode re-renders.
///
/// The number of signal expressions must match the number of closure parameters.
/// Each closure parameter receives the current value (via `.get()`) of the
/// corresponding signal.
///
/// ```ignore
/// let count = use_signal(|| 0_i32);
/// let name = use_signal(|| String::from("euv"));
/// watch!(count, name, |count_val, name_val| {
/// web_sys::console::log_1(&format!("count={}, name={}", count_val, name_val).into());
/// });
/// ```
/// The `css_vars!` macro for defining CSS custom properties.
///
/// Each variable block creates a `CssClass` function that, when called,
/// injects the CSS custom properties into the DOM. Variable names are
/// automatically prefixed with `--`.
///
/// Variable names can be written as unquoted kebab-case identifiers
/// (e.g., `bg-primary`) or as quoted string literals (e.g., `"bg-primary"`).
///
/// ```ignore
/// css_vars! {
/// pub c_theme_light {
/// bg-primary: "#f8f9fb";
/// text-primary: "#1a1a2e";
/// }
/// }
/// ```
/// The `var!` macro for referencing CSS custom properties defined via `css_vars!`.
///
/// The variable name can be written as an unquoted kebab-case identifier
/// (e.g., `bg-primary`) or as a quoted string literal (e.g., `"bg-primary"`),
/// and expands to the CSS string `"var(--bg-primary)"`.
///
/// ```ignore
/// css_vars! {
/// pub c_theme {
/// bg-primary: "#f8f9fb";
/// }
/// }
/// class! {
/// pub c_container {
/// background: var!(bg-primary);
/// }
/// }
/// ```
/// The `component` attribute macro for marking component functions.