stylex_constants/constants/
common.rs1pub static DEFAULT_INJECT_PATH: &str = "@stylexjs/stylex/lib/stylex-inject";
2use once_cell::sync::Lazy;
3use phf::phf_set;
4
5pub static VALID_CALLEES: phf::Set<&'static str> = phf_set! {
9
10 "String", "Number", "Math", "Object", "Array"
11};
12
13pub static MUTATING_ARRAY_METHODS: phf::Set<&'static str> = phf_set! {
14 "push",
15 "pop",
16 "shift",
17 "unshift",
18 "splice",
19 "sort",
20 "reverse",
21 "fill",
22 "copyWithin",
23};
24
25pub static MUTATING_OBJECT_METHODS: phf::Set<&'static str> = phf_set! {
26 "assign",
27 "defineProperty",
28 "defineProperties",
29 "setPrototypeOf",
30};
31
32pub static INVALID_METHODS: phf::Set<&'static str> = phf_set! {
33 "random",
34 "assign",
35 "defineProperties",
36 "defineProperty",
37 "freeze",
38 "seal",
39 "splice",
40};
41
42pub static COMPILED_KEY: &str = "$$css";
43
44pub static SPLIT_TOKEN: &str = "__$$__";
45
46pub static ROOT_FONT_SIZE: i8 = 16;
47
48pub static VAR_GROUP_HASH_KEY: &str = "__varGroupHash__";
49
50pub static COLOR_FUNCTION_LISTED_NORMALIZED_PROPERTY_VALUES: Lazy<[&str; 9]> = Lazy::new(|| {
51 [
52 "oklch",
53 "lch",
54 "oklab",
55 "hsla",
56 "radial-gradient",
57 "hwb",
58 "lab",
59 "clamp",
60 "hsl",
61 ]
62});
63
64pub static COLOR_RELATIVE_VALUES_LISTED_NORMALIZED_PROPERTY_VALUES: Lazy<[&str; 7]> =
65 Lazy::new(|| [" a ", " b ", " c ", " l ", " h ", " s ", " w "]);
66
67pub static CSS_CONTENT_FUNCTIONS: Lazy<[&str; 7]> = Lazy::new(|| {
68 [
69 "attr(",
70 "counter(",
71 "counters(",
72 "url(",
73 "linear-gradient(",
74 "image-set(",
75 "var(--",
76 ]
77});
78
79pub static CSS_CONTENT_KEYWORDS: Lazy<[&str; 11]> = Lazy::new(|| {
80 [
81 "normal",
82 "none",
83 "open-quote",
84 "close-quote",
85 "no-open-quote",
86 "no-close-quote",
87 "inherit",
88 "initial",
89 "revert",
90 "revert-layer",
91 "unset",
92 ]
93});
94
95pub static VALID_POSITION_TRY_PROPERTIES: Lazy<[&str; 40]> = Lazy::new(|| {
98 [
99 "anchorName",
101 "positionAnchor",
103 "positionArea",
104 "top",
106 "right",
107 "bottom",
108 "left",
109 "inset",
110 "insetBlock",
111 "insetBlockEnd",
112 "insetBlockStart",
113 "insetInline",
114 "insetInlineEnd",
115 "insetInlineStart",
116 "margin",
118 "marginBlock",
119 "marginBlockEnd",
120 "marginBlockStart",
121 "marginInline",
122 "marginInlineEnd",
123 "marginInlineStart",
124 "marginTop",
125 "marginBottom",
126 "marginLeft",
127 "marginRight",
128 "width",
130 "height",
131 "minWidth",
132 "minHeight",
133 "maxWidth",
134 "maxHeight",
135 "blockSize",
136 "inlineSize",
137 "minBlockSize",
138 "minInlineSize",
139 "maxBlockSize",
140 "maxInlineSize",
141 "alignSelf",
143 "justifySelf",
144 "placeSelf",
145 ]
146});
147
148pub static VALID_VIEW_TRANSITION_CLASS_PROPERTIES: Lazy<[&str; 4]> =
150 Lazy::new(|| ["group", "imagePair", "old", "new"]);
151
152pub static CONSTS_FILE_EXTENSION: &str = ".const";
153
154pub static LOGICAL_FLOAT_START_VAR: &str = "--stylex-logical-start";
162
163pub static LOGICAL_FLOAT_END_VAR: &str = "--stylex-logical-end";
171
172pub static RUNTIME_JSX_CALL_NAMES: &[&str] = &[
183 "jsx",
184 "jsxs",
185 "createElement",
186 "createElementBlock",
187 "createElementVNode",
188 "createVNode",
189];