windjammer_ui/components/generated/
style.rs

1#![allow(clippy::all)]
2#![allow(noop_method_call)]
3pub struct Style {
4    properties: Vec<StyleProperty>,
5}
6
7pub struct StyleProperty {
8    name: String,
9    value: String,
10}
11
12impl Style {
13    #[inline]
14    pub fn new() -> Style {
15        Style {
16            properties: Vec::new(),
17        }
18    }
19    #[inline]
20    pub fn display(mut self, value: String) -> Style {
21        self.properties.push(StyleProperty {
22            name: "display".to_string(),
23            value,
24        });
25        self
26    }
27    #[inline]
28    pub fn flex_direction(mut self, value: String) -> Style {
29        self.properties.push(StyleProperty {
30            name: "flex-direction".to_string(),
31            value,
32        });
33        self
34    }
35    #[inline]
36    pub fn gap(mut self, value: String) -> Style {
37        self.properties.push(StyleProperty {
38            name: "gap".to_string(),
39            value,
40        });
41        self
42    }
43    #[inline]
44    pub fn align_items(mut self, value: String) -> Style {
45        self.properties.push(StyleProperty {
46            name: "align-items".to_string(),
47            value,
48        });
49        self
50    }
51    #[inline]
52    pub fn justify_content(mut self, value: String) -> Style {
53        self.properties.push(StyleProperty {
54            name: "justify-content".to_string(),
55            value,
56        });
57        self
58    }
59    #[inline]
60    pub fn margin(mut self, value: String) -> Style {
61        self.properties.push(StyleProperty {
62            name: "margin".to_string(),
63            value,
64        });
65        self
66    }
67    #[inline]
68    pub fn padding(mut self, value: String) -> Style {
69        self.properties.push(StyleProperty {
70            name: "padding".to_string(),
71            value,
72        });
73        self
74    }
75    #[inline]
76    pub fn width(mut self, value: String) -> Style {
77        self.properties.push(StyleProperty {
78            name: "width".to_string(),
79            value,
80        });
81        self
82    }
83    #[inline]
84    pub fn height(mut self, value: String) -> Style {
85        self.properties.push(StyleProperty {
86            name: "height".to_string(),
87            value,
88        });
89        self
90    }
91    #[inline]
92    pub fn min_width(mut self, value: String) -> Style {
93        self.properties.push(StyleProperty {
94            name: "min-width".to_string(),
95            value,
96        });
97        self
98    }
99    #[inline]
100    pub fn max_width(mut self, value: String) -> Style {
101        self.properties.push(StyleProperty {
102            name: "max-width".to_string(),
103            value,
104        });
105        self
106    }
107    #[inline]
108    pub fn color(mut self, value: String) -> Style {
109        self.properties.push(StyleProperty {
110            name: "color".to_string(),
111            value,
112        });
113        self
114    }
115    #[inline]
116    pub fn background_color(mut self, value: String) -> Style {
117        self.properties.push(StyleProperty {
118            name: "background-color".to_string(),
119            value,
120        });
121        self
122    }
123    #[inline]
124    pub fn border_color(mut self, value: String) -> Style {
125        self.properties.push(StyleProperty {
126            name: "border-color".to_string(),
127            value,
128        });
129        self
130    }
131    #[inline]
132    pub fn border(mut self, value: String) -> Style {
133        self.properties.push(StyleProperty {
134            name: "border".to_string(),
135            value,
136        });
137        self
138    }
139    #[inline]
140    pub fn border_radius(mut self, value: String) -> Style {
141        self.properties.push(StyleProperty {
142            name: "border-radius".to_string(),
143            value,
144        });
145        self
146    }
147    #[inline]
148    pub fn font_size(mut self, value: String) -> Style {
149        self.properties.push(StyleProperty {
150            name: "font-size".to_string(),
151            value,
152        });
153        self
154    }
155    #[inline]
156    pub fn font_weight(mut self, value: String) -> Style {
157        self.properties.push(StyleProperty {
158            name: "font-weight".to_string(),
159            value,
160        });
161        self
162    }
163    #[inline]
164    pub fn text_align(mut self, value: String) -> Style {
165        self.properties.push(StyleProperty {
166            name: "text-align".to_string(),
167            value,
168        });
169        self
170    }
171    #[inline]
172    pub fn position(mut self, value: String) -> Style {
173        self.properties.push(StyleProperty {
174            name: "position".to_string(),
175            value,
176        });
177        self
178    }
179    #[inline]
180    pub fn top(mut self, value: String) -> Style {
181        self.properties.push(StyleProperty {
182            name: "top".to_string(),
183            value,
184        });
185        self
186    }
187    #[inline]
188    pub fn right(mut self, value: String) -> Style {
189        self.properties.push(StyleProperty {
190            name: "right".to_string(),
191            value,
192        });
193        self
194    }
195    #[inline]
196    pub fn bottom(mut self, value: String) -> Style {
197        self.properties.push(StyleProperty {
198            name: "bottom".to_string(),
199            value,
200        });
201        self
202    }
203    #[inline]
204    pub fn left(mut self, value: String) -> Style {
205        self.properties.push(StyleProperty {
206            name: "left".to_string(),
207            value,
208        });
209        self
210    }
211    #[inline]
212    pub fn opacity(mut self, value: String) -> Style {
213        self.properties.push(StyleProperty {
214            name: "opacity".to_string(),
215            value,
216        });
217        self
218    }
219    #[inline]
220    pub fn box_shadow(mut self, value: String) -> Style {
221        self.properties.push(StyleProperty {
222            name: "box-shadow".to_string(),
223            value,
224        });
225        self
226    }
227    #[inline]
228    pub fn cursor(mut self, value: String) -> Style {
229        self.properties.push(StyleProperty {
230            name: "cursor".to_string(),
231            value,
232        });
233        self
234    }
235    #[inline]
236    pub fn overflow(mut self, value: String) -> Style {
237        self.properties.push(StyleProperty {
238            name: "overflow".to_string(),
239            value,
240        });
241        self
242    }
243    #[inline]
244    pub fn overflow_x(mut self, value: String) -> Style {
245        self.properties.push(StyleProperty {
246            name: "overflow-x".to_string(),
247            value,
248        });
249        self
250    }
251    #[inline]
252    pub fn overflow_y(mut self, value: String) -> Style {
253        self.properties.push(StyleProperty {
254            name: "overflow-y".to_string(),
255            value,
256        });
257        self
258    }
259    #[inline]
260    pub fn to_string(&self) -> String {
261        let mut result = String::new();
262        for (i, prop) in self.properties.iter().enumerate() {
263            if i > 0 {
264                result.push_str("; ")
265            }
266            result.push_str(prop.name.as_str());
267            result.push_str(": ");
268            result.push_str(prop.value.as_str());
269        }
270        result
271    }
272}