freya_elements/attributes/svg_attributes.rs
1use crate::def_attribute;
2
3def_attribute!(
4 svg_data,
5 svg_content,
6 /// The `fill` attributes allows you to specify the fill color for the `svg`.
7 ///
8 /// You can learn about the syntax of this attribute in [`Color Syntax`](crate::_docs::color_syntax).
9 ///
10 /// ### Example
11 ///
12 /// ```rust, no_run
13 /// # use freya::prelude::*;
14 /// fn app() -> Element {
15 /// let svg_content = include_str!("../../../../examples/settings.svg");
16 ///
17 /// rsx!(
18 /// svg {
19 /// fill: "red",
20 /// width: "100%",
21 /// height: "100%",
22 /// svg_content,
23 /// }
24 /// )
25 /// }
26 /// ```
27 fill,
28
29 /// The `stroke` attributes allows you to specify stroke color for the `svg`.
30 ///
31 /// You can learn about the syntax of this attribute in [`Color Syntax`](crate::_docs::color_syntax).
32 ///
33 /// ### Example
34 ///
35 /// ```rust, no_run
36 /// # use freya::prelude::*;
37 /// fn app() -> Element {
38 /// let svg_content = include_str!("../../../../examples/settings.svg");
39 ///
40 /// rsx!(
41 /// svg {
42 /// stroke: "red",
43 /// width: "100%",
44 /// height: "100%",
45 /// svg_content,
46 /// }
47 /// )
48 /// }
49 /// ```
50 stroke,
51);