Remove property enum

This commit is contained in:
ConnorSkees 2020-01-06 17:05:34 -05:00
parent 3ba585b40d
commit ebdb4baf8f

View File

@ -677,430 +677,3 @@ impl Pos {
self.column += num;
}
}
#[derive(Debug)]
pub enum Property {
AlignContent,
AlignItems,
AlignSelf,
All,
Animation,
AnimationDelay,
AnimationDirection,
AnimationDuration,
AnimationFillMode,
AnimationIterationCount,
AnimationName,
AnimationPlayState,
AnimationTimingFunction,
BackfaceVisibility,
Background,
BackgroundAttachment,
BackgroundBlendMode,
BackgroundClip,
BackgroundColor,
BackgroundImage,
BackgroundOrigin,
BackgroundPosition,
BackgroundRepeat,
BackgroundSize,
Border,
BorderBottom,
BorderBottomColor,
BorderBottomLeftRadius,
BorderBottomRightRadius,
BorderBottomStyle,
BorderBottomWidth,
BorderCollapse,
BorderColor,
BorderImage,
BorderImageOutset,
BorderImageRepeat,
BorderImageSlice,
BorderImageSource,
BorderImageWidth,
BorderLeft,
BorderLeftColor,
BorderLeftStyle,
BorderLeftWidth,
BorderRadius,
BorderRight,
BorderRightColor,
BorderRightStyle,
BorderRightWidth,
BorderSpacing,
BorderStyle,
BorderTop,
BorderTopColor,
BorderTopLeftRadius,
BorderTopRightRadius,
BorderTopStyle,
BorderTopWidth,
BorderWidth,
Bottom,
BoxDecorationBreak,
BoxShadow,
BoxSizing,
CaptionSide,
CaretColor,
Charset,
Clear,
Clip,
Color,
ColumnCount,
ColumnFill,
ColumnGap,
ColumnRule,
ColumnRuleColor,
ColumnRuleStyle,
ColumnRuleWidth,
ColumnSpan,
ColumnWidth,
Columns,
Content,
CounterIncrement,
CounterReset,
Cursor,
Direction,
Display,
EmptyCells,
Filter,
Flex,
FlexBasis,
FlexDirection,
FlexFlow,
FlexGrow,
FlexShrink,
FlexWrap,
Float,
Font,
FontFace,
FontFamily,
FontKerning,
FontSize,
FontSizeAdjust,
FontStretch,
FontStyle,
FontVariant,
FontWeight,
Grid,
GridArea,
GridAutoColumns,
GridAutoFlow,
GridAutoRows,
GridColumn,
GridColumnEnd,
GridColumnGap,
GridColumnStart,
GridGap,
GridRow,
GridRowEnd,
GridRowGap,
GridRowStart,
GridTemplate,
GridTemplateAreas,
GridTemplateColumns,
GridTemplateRows,
HangingPunctuation,
Height,
Hyphens,
Import,
Isolation,
JustifyContent,
Keyframes,
Left,
LetterSpacing,
LineHeight,
ListStyle,
ListStyleImage,
ListStylePosition,
ListStyleType,
Margin,
MarginBottom,
MarginLeft,
MarginRight,
MarginTop,
MaxHeight,
MaxWidth,
Media,
MinHeight,
MinWidth,
MixBlendMode,
ObjectFit,
ObjectPosition,
Opacity,
Order,
Outline,
OutlineColor,
OutlineOffset,
OutlineStyle,
OutlineWidth,
Overflow,
OverflowX,
OverflowY,
Padding,
PaddingBottom,
PaddingLeft,
PaddingRight,
PaddingTop,
PageBreakAfter,
PageBreakBefore,
PageBreakInside,
Perspective,
PerspectiveOrigin,
PointerEvents,
Position,
Quotes,
Resize,
Right,
ScrollBehavior,
TabSize,
TableLayout,
TextAlign,
TextAlignLast,
TextDecoration,
TextDecorationColor,
TextDecorationLine,
TextDecorationStyle,
TextIndent,
TextJustify,
TextOverflow,
TextShadow,
TextTransform,
Top,
Transform,
TransformOrigin,
TransformStyle,
Transition,
TransitionDelay,
TransitionDuration,
TransitionProperty,
TransitionTimingFunction,
UnicodeBidi,
UserSelect,
VerticalAlign,
Visibility,
WhiteSpace,
Width,
WordBreak,
WordSpacing,
WordWrap,
WritingMode,
ZIndex,
}
impl TryFrom<&str> for Property {
type Error = &'static str;
fn try_from(string: &str) -> Result<Property, Self::Error> {
match string {
"align-content" => Ok(Property::AlignContent),
"align-items" => Ok(Property::AlignItems),
"align-self" => Ok(Property::AlignSelf),
"all" => Ok(Property::All),
"animation" => Ok(Property::Animation),
"animation-delay" => Ok(Property::AnimationDelay),
"animation-direction" => Ok(Property::AnimationDirection),
"animation-duration" => Ok(Property::AnimationDuration),
"animation-fill-mode" => Ok(Property::AnimationFillMode),
"animation-iteration-count" => Ok(Property::AnimationIterationCount),
"animation-name" => Ok(Property::AnimationName),
"animation-play-state" => Ok(Property::AnimationPlayState),
"animation-timing-function" => Ok(Property::AnimationTimingFunction),
"backface-visibility" => Ok(Property::BackfaceVisibility),
"background" => Ok(Property::Background),
"background-attachment" => Ok(Property::BackgroundAttachment),
"background-blend-mode" => Ok(Property::BackgroundBlendMode),
"background-clip" => Ok(Property::BackgroundClip),
"background-color" => Ok(Property::BackgroundColor),
"background-image" => Ok(Property::BackgroundImage),
"background-origin" => Ok(Property::BackgroundOrigin),
"background-position" => Ok(Property::BackgroundPosition),
"background-repeat" => Ok(Property::BackgroundRepeat),
"background-size" => Ok(Property::BackgroundSize),
"border" => Ok(Property::Border),
"border-bottom" => Ok(Property::BorderBottom),
"border-bottom-color" => Ok(Property::BorderBottomColor),
"border-bottom-left-radius" => Ok(Property::BorderBottomLeftRadius),
"border-bottom-right-radius" => Ok(Property::BorderBottomRightRadius),
"border-bottom-style" => Ok(Property::BorderBottomStyle),
"border-bottom-width" => Ok(Property::BorderBottomWidth),
"border-collapse" => Ok(Property::BorderCollapse),
"border-color" => Ok(Property::BorderColor),
"border-image" => Ok(Property::BorderImage),
"border-image-outset" => Ok(Property::BorderImageOutset),
"border-image-repeat" => Ok(Property::BorderImageRepeat),
"border-image-slice" => Ok(Property::BorderImageSlice),
"border-image-source" => Ok(Property::BorderImageSource),
"border-image-width" => Ok(Property::BorderImageWidth),
"border-left" => Ok(Property::BorderLeft),
"border-left-color" => Ok(Property::BorderLeftColor),
"border-left-style" => Ok(Property::BorderLeftStyle),
"border-left-width" => Ok(Property::BorderLeftWidth),
"border-radius" => Ok(Property::BorderRadius),
"border-right" => Ok(Property::BorderRight),
"border-right-color" => Ok(Property::BorderRightColor),
"border-right-style" => Ok(Property::BorderRightStyle),
"border-right-width" => Ok(Property::BorderRightWidth),
"border-spacing" => Ok(Property::BorderSpacing),
"border-style" => Ok(Property::BorderStyle),
"border-top" => Ok(Property::BorderTop),
"border-top-color" => Ok(Property::BorderTopColor),
"border-top-left-radius" => Ok(Property::BorderTopLeftRadius),
"border-top-right-radius" => Ok(Property::BorderTopRightRadius),
"border-top-style" => Ok(Property::BorderTopStyle),
"border-top-width" => Ok(Property::BorderTopWidth),
"border-width" => Ok(Property::BorderWidth),
"bottom" => Ok(Property::Bottom),
"box-decoration-break" => Ok(Property::BoxDecorationBreak),
"box-shadow" => Ok(Property::BoxShadow),
"box-sizing" => Ok(Property::BoxSizing),
"caption-side" => Ok(Property::CaptionSide),
"caret-color" => Ok(Property::CaretColor),
"@charset" => Ok(Property::Charset),
"clear" => Ok(Property::Clear),
"clip" => Ok(Property::Clip),
"color" => Ok(Property::Color),
"column-count" => Ok(Property::ColumnCount),
"column-fill" => Ok(Property::ColumnFill),
"column-gap" => Ok(Property::ColumnGap),
"column-rule" => Ok(Property::ColumnRule),
"column-rule-color" => Ok(Property::ColumnRuleColor),
"column-rule-style" => Ok(Property::ColumnRuleStyle),
"column-rule-width" => Ok(Property::ColumnRuleWidth),
"column-span" => Ok(Property::ColumnSpan),
"column-width" => Ok(Property::ColumnWidth),
"columns" => Ok(Property::Columns),
"content" => Ok(Property::Content),
"counter-increment" => Ok(Property::CounterIncrement),
"counter-reset" => Ok(Property::CounterReset),
"cursor" => Ok(Property::Cursor),
"direction" => Ok(Property::Direction),
"display" => Ok(Property::Display),
"empty-cells" => Ok(Property::EmptyCells),
"filter" => Ok(Property::Filter),
"flex" => Ok(Property::Flex),
"flex-basis" => Ok(Property::FlexBasis),
"flex-direction" => Ok(Property::FlexDirection),
"flex-flow" => Ok(Property::FlexFlow),
"flex-grow" => Ok(Property::FlexGrow),
"flex-shrink" => Ok(Property::FlexShrink),
"flex-wrap" => Ok(Property::FlexWrap),
"float" => Ok(Property::Float),
"font" => Ok(Property::Font),
"@font-face" => Ok(Property::FontFace),
"font-family" => Ok(Property::FontFamily),
"font-kerning" => Ok(Property::FontKerning),
"font-size" => Ok(Property::FontSize),
"font-size-adjust" => Ok(Property::FontSizeAdjust),
"font-stretch" => Ok(Property::FontStretch),
"font-style" => Ok(Property::FontStyle),
"font-variant" => Ok(Property::FontVariant),
"font-weight" => Ok(Property::FontWeight),
"grid" => Ok(Property::Grid),
"grid-area" => Ok(Property::GridArea),
"grid-auto-columns" => Ok(Property::GridAutoColumns),
"grid-auto-flow" => Ok(Property::GridAutoFlow),
"grid-auto-rows" => Ok(Property::GridAutoRows),
"grid-column" => Ok(Property::GridColumn),
"grid-column-end" => Ok(Property::GridColumnEnd),
"grid-column-gap" => Ok(Property::GridColumnGap),
"grid-column-start" => Ok(Property::GridColumnStart),
"grid-gap" => Ok(Property::GridGap),
"grid-row" => Ok(Property::GridRow),
"grid-row-end" => Ok(Property::GridRowEnd),
"grid-row-gap" => Ok(Property::GridRowGap),
"grid-row-start" => Ok(Property::GridRowStart),
"grid-template" => Ok(Property::GridTemplate),
"grid-template-areas" => Ok(Property::GridTemplateAreas),
"grid-template-columns" => Ok(Property::GridTemplateColumns),
"grid-template-rows" => Ok(Property::GridTemplateRows),
"hanging-punctuation" => Ok(Property::HangingPunctuation),
"height" => Ok(Property::Height),
"hyphens" => Ok(Property::Hyphens),
"@import" => Ok(Property::Import),
"isolation" => Ok(Property::Isolation),
"justify-content" => Ok(Property::JustifyContent),
"@keyframes" => Ok(Property::Keyframes),
"left" => Ok(Property::Left),
"letter-spacing" => Ok(Property::LetterSpacing),
"line-height" => Ok(Property::LineHeight),
"list-style" => Ok(Property::ListStyle),
"list-style-image" => Ok(Property::ListStyleImage),
"list-style-position" => Ok(Property::ListStylePosition),
"list-style-type" => Ok(Property::ListStyleType),
"margin" => Ok(Property::Margin),
"margin-bottom" => Ok(Property::MarginBottom),
"margin-left" => Ok(Property::MarginLeft),
"margin-right" => Ok(Property::MarginRight),
"margin-top" => Ok(Property::MarginTop),
"max-height" => Ok(Property::MaxHeight),
"max-width" => Ok(Property::MaxWidth),
"@media" => Ok(Property::Media),
"min-height" => Ok(Property::MinHeight),
"min-width" => Ok(Property::MinWidth),
"mix-blend-mode" => Ok(Property::MixBlendMode),
"object-fit" => Ok(Property::ObjectFit),
"object-position" => Ok(Property::ObjectPosition),
"opacity" => Ok(Property::Opacity),
"order" => Ok(Property::Order),
"outline" => Ok(Property::Outline),
"outline-color" => Ok(Property::OutlineColor),
"outline-offset" => Ok(Property::OutlineOffset),
"outline-style" => Ok(Property::OutlineStyle),
"outline-width" => Ok(Property::OutlineWidth),
"overflow" => Ok(Property::Overflow),
"overflow-x" => Ok(Property::OverflowX),
"overflow-y" => Ok(Property::OverflowY),
"padding" => Ok(Property::Padding),
"padding-bottom" => Ok(Property::PaddingBottom),
"padding-left" => Ok(Property::PaddingLeft),
"padding-right" => Ok(Property::PaddingRight),
"padding-top" => Ok(Property::PaddingTop),
"page-break-after" => Ok(Property::PageBreakAfter),
"page-break-before" => Ok(Property::PageBreakBefore),
"page-break-inside" => Ok(Property::PageBreakInside),
"perspective" => Ok(Property::Perspective),
"perspective-origin" => Ok(Property::PerspectiveOrigin),
"pointer-events" => Ok(Property::PointerEvents),
"position" => Ok(Property::Position),
"quotes" => Ok(Property::Quotes),
"resize" => Ok(Property::Resize),
"right" => Ok(Property::Right),
"scroll-behavior" => Ok(Property::ScrollBehavior),
"tab-size" => Ok(Property::TabSize),
"table-layout" => Ok(Property::TableLayout),
"text-align" => Ok(Property::TextAlign),
"text-align-last" => Ok(Property::TextAlignLast),
"text-decoration" => Ok(Property::TextDecoration),
"text-decoration-color" => Ok(Property::TextDecorationColor),
"text-decoration-line" => Ok(Property::TextDecorationLine),
"text-decoration-style" => Ok(Property::TextDecorationStyle),
"text-indent" => Ok(Property::TextIndent),
"text-justify" => Ok(Property::TextJustify),
"text-overflow" => Ok(Property::TextOverflow),
"text-shadow" => Ok(Property::TextShadow),
"text-transform" => Ok(Property::TextTransform),
"top" => Ok(Property::Top),
"transform" => Ok(Property::Transform),
"transform-origin" => Ok(Property::TransformOrigin),
"transform-style" => Ok(Property::TransformStyle),
"transition" => Ok(Property::Transition),
"transition-delay" => Ok(Property::TransitionDelay),
"transition-duration" => Ok(Property::TransitionDuration),
"transition-property" => Ok(Property::TransitionProperty),
"transition-timing-function" => Ok(Property::TransitionTimingFunction),
"unicode-bidi" => Ok(Property::UnicodeBidi),
"user-select" => Ok(Property::UserSelect),
"vertical-align" => Ok(Property::VerticalAlign),
"visibility" => Ok(Property::Visibility),
"white-space" => Ok(Property::WhiteSpace),
"width" => Ok(Property::Width),
"word-break" => Ok(Property::WordBreak),
"word-spacing" => Ok(Property::WordSpacing),
"word-wrap" => Ok(Property::WordWrap),
"writing-mode" => Ok(Property::WritingMode),
"z-index" => Ok(Property::ZIndex),
_ => Err("invalid property"),
}
}
}