freya_elements/attributes/transform_attributes.rs
1use crate::def_attribute;
2
3def_attribute!(
4 /// Specify the rotation for this element.
5 ///
6 /// Syntax is `<0-360>deg`.
7 ///
8 /// Note: Rotations don't affect neither layout or mouse events, they are merely a rendering effect.
9 ///
10 /// ### Example
11 ///
12 /// ```rust, no_run
13 /// # use freya::prelude::*;
14 /// fn app() -> Element {
15 /// rsx!(
16 /// rect {
17 /// background: "red",
18 /// rotate: "180deg",
19 /// label {
20 /// "Freya!"
21 /// }
22 /// }
23 /// )
24 /// }
25 /// ```
26 rotate,
27
28 /// Specify the opacity for this element.
29 ///
30 /// Accepted values is from `0` to `1`.
31 ///
32 /// ### Example
33 ///
34 /// ```rust, no_run
35 /// # use freya::prelude::*;
36 /// fn app() -> Element {
37 /// rsx!(
38 /// rect {
39 /// opacity: "0.5",
40 /// label {
41 /// "Freya!"
42 /// }
43 /// }
44 /// )
45 /// }
46 /// ```
47 opacity,
48
49 /// Specify the scale for this element.
50 ///
51 /// Accepted syntax:
52 /// - `<f32>`: Same value for both scale x and y.
53 /// - `<f32>, <f32>`: Specify the scale x and y separately.
54 ///
55 /// Note: Scaling doesn't affect neither layout or mouse events, it is only a rendering effect.
56 ///
57 /// ### Example
58 ///
59 /// ```rust, no_run
60 /// # use freya::prelude::*;
61 /// fn app() -> Element {
62 /// rsx!(
63 /// rect {
64 /// background: "red",
65 /// scale: "0.7",
66 /// label {
67 /// "Freya!"
68 /// }
69 /// }
70 /// )
71 /// }
72 /// ```
73 scale,
74
75);