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
//! Helper functions for CSS property manipulation
//!
//! Note: These functions are maintained for backward compatibility.
//! New code should use the Platform trait directly.
use RefCell;
use Rc;
use Platform;
use CssProperty;
/// Set a single CSS property on an element
///
/// # Arguments
///
/// * `platform` - Platform reference for DOM operations
/// * `element` - The element to modify
/// * `property` - The CSS property to set
/// * `value` - The value to set the property to
///
/// # Example
///
/// ```ignore
/// set_style(&platform, &element, CssProperty::Width, "100px");
/// set_style(&platform, &element, CssProperty::Display, "flex");
/// ```
/// Set multiple CSS properties on an element at once
///
/// This is more efficient than calling `set_style` multiple times
/// as it minimizes DOM access overhead.
///
/// # Arguments
///
/// * `platform` - Platform reference for DOM operations
/// * `element` - The element to modify
/// * `properties` - Slice of (property, value) tuples
///
/// # Example
///
/// ```ignore
/// set_styles(&platform, &element, &[
/// (CssProperty::Display, "flex"),
/// (CssProperty::FlexDirection, "column"),
/// (CssProperty::Gap, "1rem"),
/// ]);
/// ```
/// Remove a CSS property from an element
///
/// Note: In WIT environments, removing a style property means
/// setting it to an empty string.
///
/// # Arguments
///
/// * `platform` - Platform reference for DOM operations
/// * `element` - The element to modify
/// * `property` - The CSS property to remove
///
/// # Example
///
/// ```ignore
/// remove_style(&platform, &element, CssProperty::Width);
/// ```
/// Get the computed value of a CSS property
///
/// Note: In WIT environments, getting computed styles is not directly
/// supported. This function returns an empty string.
///
/// # Arguments
///
/// * `_platform` - Platform reference (unused in WIT)
/// * `_element` - The element to query
/// * `_property` - The CSS property to get
///
/// # Returns
///
/// An empty string (computed styles not available in WIT)
///
/// # Example
///
/// ```ignore
/// let width = get_style(&platform, &element, CssProperty::Width);
/// ```