1pub static KNOWN_PROPERTIES: &[&str] = &[
5 "display", "position", "top", "right", "bottom", "left", "z-index",
6 "float", "clear", "box-sizing", "overflow", "overflow-x", "overflow-y",
7 "flex", "flex-direction", "flex-wrap", "flex-flow", "justify-content",
8 "align-items", "align-content", "align-self", "flex-grow", "flex-shrink",
9 "flex-basis", "gap", "row-gap", "column-gap", "order",
10 "width", "height", "min-width", "max-width", "min-height", "max-height",
11 "margin", "margin-top", "margin-right", "margin-bottom", "margin-left",
12 "padding", "padding-top", "padding-right", "padding-bottom", "padding-left",
13 "color", "background-color", "background", "font-size", "font-weight",
14 "font-family", "line-height", "text-align", "text-decoration", "text-transform",
15 "letter-spacing", "white-space", "word-break",
16 "border", "border-width", "border-color", "border-style", "border-radius",
17 "border-top", "border-right", "border-bottom", "border-left",
18 "opacity", "visibility", "cursor", "box-shadow", "transform", "transform-origin",
19 "transition", "transition-duration", "transition-timing-function", "transition-delay",
20 "animation", "animation-duration", "animation-timing-function", "animation-delay",
21 "animation-iteration-count", "animation-direction", "animation-fill-mode",
22 "scrollbar-width", "scrollbar-color",
23];
24
25pub static CSS_TO_IR: &[(&str, &str)] = &[
26 ("background-color", "bg_color"),
27 ("color", "color"),
28 ("width", "width"),
29 ("height", "height"),
30 ("min-width", "min_width"),
31 ("max-width", "max_width"),
32 ("min-height", "min_height"),
33 ("max-height", "max_height"),
34 ("margin", "margin"),
35 ("padding", "padding"),
36 ("border-radius", "border_radius"),
37 ("font-size", "font_size"),
38 ("font-weight", "font_weight"),
39 ("text-align", "text_align"),
40 ("display", "display"),
41 ("flex-direction", "flex_dir"),
42 ("flex-grow", "flex_grow"),
43 ("flex-shrink", "flex_shrink"),
44 ("flex-basis", "flex_basis"),
45 ("gap", "gap"),
46 ("position", "position"),
47 ("left", "left"),
48 ("right", "right"),
49 ("top", "top"),
50 ("bottom", "bottom"),
51 ("justify-content", "justify_content"),
52 ("align-items", "align_items"),
53 ("flex-wrap", "flex_wrap"),
54 ("cursor", "cursor"),
55 ("overflow", "overflow"),
56 ("border-width", "border_width"),
57 ("border-color", "border_color"),
58 ("border-style", "border_style"),
59 ("box-sizing", "box_sizing"),
60 ("z-index", "z_index"),
61 ("opacity", "opacity"),
62 ("transform", "transform"),
63 ("transform-origin", "transform_origin"),
64];
65
66pub fn is_known_property(prop: &str) -> bool {
67 KNOWN_PROPERTIES.contains(&prop)
68}
69
70pub fn property_feature(prop: &str) -> Option<&'static str> {
71 match prop {
72 "display" | "flex-direction" | "justify-content" | "align-items" | "gap" | "flex-wrap" | "flex-grow" | "flex-shrink" => Some("flex"),
73 "border-radius" => Some("radius"),
74 "opacity" => Some("opacity"),
75 "transform" | "transform-origin" => Some("transform"),
76 "animation" | "animation-duration" => Some("animation"),
77 "scrollbar-width" | "scrollbar-color" => Some("scrollbar"),
78 "position" | "top" | "right" | "bottom" | "left" | "z-index" => Some("positioning"),
79 _ => None,
80 }
81}