@@ -104,3 +104,109 @@ pub enum CSSPropertyType {
104
104
Padding = 99 ,
105
105
BorderRadius = 100 ,
106
106
}
107
+
108
+ pub fn string_to_css_property_type ( property : & str ) -> CSSPropertyType {
109
+ match property {
110
+ "alignContent" => CSSPropertyType :: AlignContent ,
111
+ "justifyContent" => CSSPropertyType :: JustifyContent ,
112
+ "alignItems" => CSSPropertyType :: AlignItems ,
113
+ "alignSelf" => CSSPropertyType :: AlignSelf ,
114
+ "flexBasis" => CSSPropertyType :: FlexBasis ,
115
+ "flexDirection" => CSSPropertyType :: FlexDirection ,
116
+ "flexGrow" => CSSPropertyType :: FlexGrow ,
117
+ "flexShrink" => CSSPropertyType :: FlexShrink ,
118
+ "flexWrap" => CSSPropertyType :: FlexWrap ,
119
+ "aspectRatio" => CSSPropertyType :: AspectRatio ,
120
+ "display" => CSSPropertyType :: Display ,
121
+ "columnGap" => CSSPropertyType :: ColumnGap ,
122
+ "rowGap" => CSSPropertyType :: RowGap ,
123
+ "marginLeft" => CSSPropertyType :: MarginLeft ,
124
+ "marginRight" => CSSPropertyType :: MarginRight ,
125
+ "marginTop" => CSSPropertyType :: MarginTop ,
126
+ "marginBottom" => CSSPropertyType :: MarginBottom ,
127
+ "paddingLeft" => CSSPropertyType :: PaddingLeft ,
128
+ "paddingRight" => CSSPropertyType :: PaddingRight ,
129
+ "paddingTop" => CSSPropertyType :: PaddingTop ,
130
+ "paddingBottom" => CSSPropertyType :: PaddingBottom ,
131
+ "width" => CSSPropertyType :: Width ,
132
+ "minWidth" => CSSPropertyType :: MinWidth ,
133
+ "maxWidth" => CSSPropertyType :: MaxWidth ,
134
+ "height" => CSSPropertyType :: Height ,
135
+ "minHeight" => CSSPropertyType :: MinHeight ,
136
+ "maxHeight" => CSSPropertyType :: MaxHeight ,
137
+ "overflow" => CSSPropertyType :: Overflow ,
138
+ "fontSize" => CSSPropertyType :: FontSize ,
139
+ "fontStyle" => CSSPropertyType :: FontStyle ,
140
+ "fontFamily" => CSSPropertyType :: FontFamily ,
141
+ "fontWeight" => CSSPropertyType :: FontWeight ,
142
+ "lineHeight" => CSSPropertyType :: LineHeight ,
143
+ "letterSpacing" => CSSPropertyType :: LetterSpacing ,
144
+ "verticalAlign" => CSSPropertyType :: VerticalAlign ,
145
+ "textAlign" => CSSPropertyType :: TextAlign ,
146
+ "textDecoration" => CSSPropertyType :: TextDecoration ,
147
+ "textShadow" => CSSPropertyType :: TextShadow ,
148
+ "textOverflow" => CSSPropertyType :: TextOverflow ,
149
+ "textTransform" => CSSPropertyType :: TextTransform ,
150
+ "color" => CSSPropertyType :: Color ,
151
+ "backgroundColor" => CSSPropertyType :: BackgroundColor ,
152
+ "backgroundImage" => CSSPropertyType :: BackgroundImage ,
153
+ "backgroundPosition" => CSSPropertyType :: BackgroundPosition ,
154
+ "backgroundSize" => CSSPropertyType :: BackgroundSize ,
155
+ "backgroundRepeat" => CSSPropertyType :: BackgroundRepeat ,
156
+ "borderTopColor" => CSSPropertyType :: BorderTopColor ,
157
+ "borderRightColor" => CSSPropertyType :: BorderRightColor ,
158
+ "borderBottomColor" => CSSPropertyType :: BorderBottomColor ,
159
+ "borderLeftColor" => CSSPropertyType :: BorderLeftColor ,
160
+ "borderTopStyle" => CSSPropertyType :: BorderTopStyle ,
161
+ "borderRightStyle" => CSSPropertyType :: BorderRightStyle ,
162
+ "borderBottomStyle" => CSSPropertyType :: BorderBottomStyle ,
163
+ "borderLeftStyle" => CSSPropertyType :: BorderLeftStyle ,
164
+ "borderTopWidth" => CSSPropertyType :: BorderTopWidth ,
165
+ "borderRightWidth" => CSSPropertyType :: BorderRightWidth ,
166
+ "borderBottomWidth" => CSSPropertyType :: BorderBottomWidth ,
167
+ "borderLeftWidth" => CSSPropertyType :: BorderLeftWidth ,
168
+ "borderTopLeftRadius" => CSSPropertyType :: BorderTopLeftRadius ,
169
+ "borderTopRightRadius" => CSSPropertyType :: BorderTopRightRadius ,
170
+ "borderBottomLeftRadius" => CSSPropertyType :: BorderBottomLeftRadius ,
171
+ "borderBottomRightRadius" => CSSPropertyType :: BorderBottomRightRadius ,
172
+ "boxShadow" => CSSPropertyType :: BoxShadow ,
173
+ "zIndex" => CSSPropertyType :: ZIndex ,
174
+ "position" => CSSPropertyType :: Position ,
175
+ "top" => CSSPropertyType :: Top ,
176
+ "right" => CSSPropertyType :: Right ,
177
+ "bottom" => CSSPropertyType :: Bottom ,
178
+ "left" => CSSPropertyType :: Left ,
179
+ "visibility" => CSSPropertyType :: Visibility ,
180
+ "opacity" => CSSPropertyType :: Opacity ,
181
+ "transform" => CSSPropertyType :: Transform ,
182
+ "transformOrigin" => CSSPropertyType :: TransformOrigin ,
183
+ "animationKeyFrames" => CSSPropertyType :: AnimationKeyFrames ,
184
+ "animationDuration" => CSSPropertyType :: AnimationDuration ,
185
+ "animationTimingFunction" => CSSPropertyType :: AnimationTimingFunction ,
186
+ "animationDelay" => CSSPropertyType :: AnimationDelay ,
187
+ "animationIterationCount" => CSSPropertyType :: AnimationIterationCount ,
188
+ "content" => CSSPropertyType :: Content ,
189
+ "wordBreak" => CSSPropertyType :: WordBreak ,
190
+ "webkitLineClamp" => CSSPropertyType :: WebkitLineClamp ,
191
+ "animationFillMode" => CSSPropertyType :: AnimationFillMode ,
192
+ "backgroundPositionX" => CSSPropertyType :: BackgroundPositionX ,
193
+ "backgroundPositionY" => CSSPropertyType :: BackgroundPositionY ,
194
+ "transition" => CSSPropertyType :: Transition ,
195
+ "transitionProperty" => CSSPropertyType :: TransitionProperty ,
196
+ "transitionDuration" => CSSPropertyType :: TransitionDuration ,
197
+ "transitionTimingFunction" => CSSPropertyType :: TransitionTimingFunction ,
198
+ "transitionDelay" => CSSPropertyType :: TransitionDelay ,
199
+ "whiteSpace" => CSSPropertyType :: WhiteSpace ,
200
+ "textDecorationLine" => CSSPropertyType :: TextDecorationLine ,
201
+ "textDecorationThickness" => CSSPropertyType :: TextDecorationThickness ,
202
+ "textDecorationStyle" => CSSPropertyType :: TextDecorationStyle ,
203
+ "textDecorationColor" => CSSPropertyType :: TextDecorationColor ,
204
+ "animationName" => CSSPropertyType :: AnimationName ,
205
+ "borderWidth" => CSSPropertyType :: BorderWidth ,
206
+ "borderColor" => CSSPropertyType :: BorderColor ,
207
+ "margin" => CSSPropertyType :: Margin ,
208
+ "padding" => CSSPropertyType :: Padding ,
209
+ "borderRadius" => CSSPropertyType :: BorderRadius ,
210
+ _ => CSSPropertyType :: Invalid ,
211
+ }
212
+ }
0 commit comments