Crate azul_css_parser

Source
Expand description

Provides a reference implementation of a style parser for Azul, capable of parsing CSS stylesheets into their respective Css counterparts.

Structs§

CssParseError
Error that can happen during the parsing of a CSS value
CssParseWarnMsg
ErrorLocation
HotReloader
Allows dynamic reloading of a CSS file at application runtime.
InvalidValueErr
Simple “invalid value” error, used for
LayoutMargin
Represents a parsed padding attribute
LayoutPadding
Represents a parsed padding attribute
QuoteStripped
A string that has been stripped of the beginning and ending quote
StyleBorderRadius
UnclosedQuotesError
String has unbalanced ' or " quotation marks
UnparsedCssRuleBlock

Enums§

CssBackgroundParseError
CssBackgroundPositionParseError
CssBorderParseError
CssColorComponent
CssColorParseError
CssDirectionCornerParseError
CssDirectionParseError
CssGradientStopParseError
CssImageParseError
CssParseErrorInner
CssParseWarnMsgInner
CssParsingError
Error containing all sub-errors that could happen during CSS parsing
CssPathParseError
CssPseudoSelectorParseError
CssShadowParseError
CssShapeParseError
CssStyleBorderRadiusParseError
CssStyleFontFamilyParseError
CssSyntaxError
List of all supported errors.
DynamicCssParseError
Error that can happen during css_parser::parse_key_value_pair
FlexGrowParseError
FlexShrinkParseError
LayoutMarginParseError
LayoutPaddingParseError
ParenthesisParseError
PercentageParseError
PixelParseError
PixelValueWithAuto

Constants§

DEFAULT_RELOAD_INTERVAL

Functions§

css_color_to_string
Formats a ColorU in hex format
new_from_str
normalize_color_stops
parse_background_position_horizontal
parse_background_position_vertical
parse_color_builtin
Parse a built-in background color
parse_color_hsl
Parse a color of the form ‘hsl([0.0-360.0]deg, [0-100]%, [0-100]%)’, or ‘hsla([0.0-360.0]deg, [0-100]%, [0-100]%, [0.0-1.0])’ without the leading ‘hsl[a](’ or trailing ‘)’. Alpha defaults to 255.
parse_color_hsl_components
Parse the color components passed as arguments to an hsl(…) CSS color.
parse_color_no_hash
Parse a background color, WITHOUT THE HASH
parse_color_rgb
Parse a color of the form rgb([0-255], [0-255], [0-255]), or rgba([0-255], [0-255], [0-255], [0.0-1.0]) without the leading rgb[a]( or trailing ). Alpha defaults to 255.
parse_color_rgb_components
Parse the color components passed as arguments to an rgb(…) CSS color.
parse_combined_css_property
Parses a combined CSS property or a CSS property shorthand, for example “margin” (as a shorthand for setting all four properties of “margin-top”, “margin-bottom”, “margin-left” and “margin-right”)
parse_css_color
Parse any valid CSS color, INCLUDING THE HASH
parse_css_path
Parses a CSS path from a string (only the path,.no commas allowed)
parse_css_property
Main parsing function, takes a stringified key / value pair and either returns the parsed value or an error
parse_direction
Parses an direction such as "50deg" or "to right bottom" (in the context of gradients)
parse_direction_corner
parse_float_value
parse_gradient
parse_gradient_stop
parse_image
parse_layout_align_content
Parses a LayoutAlignContent attribute from a &str
parse_layout_align_items
Parses a LayoutAlignItems attribute from a &str
parse_layout_bottom
Parses a LayoutBottom attribute from a &str
parse_layout_box_sizing
Parses a LayoutBoxSizing attribute from a &str
parse_layout_direction
Parses a LayoutDirection attribute from a &str
parse_layout_display
Parses a LayoutDisplay attribute from a &str
parse_layout_flex_grow
parse_layout_flex_shrink
parse_layout_float
Parses a LayoutFloat attribute from a &str
parse_layout_height
Parses a LayoutHeight attribute from a &str
parse_layout_justify_content
Parses a LayoutJustifyContent attribute from a &str
parse_layout_left
Parses a LayoutLeft attribute from a &str
parse_layout_margin
parse_layout_margin_bottom
Parses a LayoutMarginBottom attribute from a &str
parse_layout_margin_left
Parses a LayoutMarginLeft attribute from a &str
parse_layout_margin_right
Parses a LayoutMarginRight attribute from a &str
parse_layout_margin_top
Parses a LayoutMarginTop attribute from a &str
parse_layout_max_height
Parses a LayoutMaxHeight attribute from a &str
parse_layout_max_width
Parses a LayoutMaxWidth attribute from a &str
parse_layout_min_height
Parses a LayoutMinHeight attribute from a &str
parse_layout_min_width
Parses a LayoutMinWidth attribute from a &str
parse_layout_overflow
Parses a Overflow attribute from a &str
parse_layout_padding
Parse a padding value such as
parse_layout_padding_bottom
Parses a LayoutPaddingBottom attribute from a &str
parse_layout_padding_left
Parses a LayoutPaddingLeft attribute from a &str
parse_layout_padding_right
Parses a LayoutPaddingRight attribute from a &str
parse_layout_padding_top
Parses a LayoutPaddingTop attribute from a &str
parse_layout_position
Parses a LayoutPosition attribute from a &str
parse_layout_right
Parses a LayoutRight attribute from a &str
parse_layout_text_align
Parses a StyleTextAlignmentHorz attribute from a &str
parse_layout_top
Parses a LayoutTop attribute from a &str
parse_layout_width
Parses a LayoutWidth attribute from a &str
parse_layout_wrap
Parses a LayoutWrap attribute from a &str
parse_parentheses
Checks wheter a given input is enclosed in parentheses, prefixed by a certain number of stopwords.
parse_percentage
parse_percentage_value
parse_pixel_value
parse_pixel_value_no_percent
parse_pixel_value_with_auto
Parses a pixel value, but also tries values like “auto”, “initial”, “inherit” and “none”
parse_shape
Parses a Shape attribute from a &str
parse_style_background_content
parse_style_background_position
parse_style_background_repeat
Parses a StyleBackgroundRepeat attribute from a &str
parse_style_background_size
Parses a StyleBackgroundSize attribute from a &str
parse_style_border
Parse a CSS border such as
parse_style_border_bottom_left_radius
Parses a StyleBorderBottomLeftRadius attribute from a &str
parse_style_border_bottom_right_radius
Parses a StyleBorderBottomRightRadius attribute from a &str
parse_style_border_bottom_width
Parses a StyleBorderBottomWidth attribute from a &str
parse_style_border_left_width
Parses a StyleBorderLeftWidth attribute from a &str
parse_style_border_radius
parse the border-radius like “5px 10px” or “5px 10px 6px 10px”
parse_style_border_right_width
Parses a StyleBorderRightWidth attribute from a &str
parse_style_border_style
Parses a BorderStyle attribute from a &str
parse_style_border_top_left_radius
Parses a StyleBorderTopLeftRadius attribute from a &str
parse_style_border_top_right_radius
Parses a StyleBorderTopRightRadius attribute from a &str
parse_style_border_top_width
Parses a StyleBorderTopWidth attribute from a &str
parse_style_box_shadow
Parses a CSS box-shadow, such as “5px 10px inset”
parse_style_cursor
Parses a StyleCursor attribute from a &str
parse_style_font_family
Parses a StyleFontFamily declaration from a &str
parse_style_font_size
Parses a StyleFontSize attribute from a &str
parse_style_letter_spacing
Parses a StyleLetterSpacing attribute from a &str
parse_style_line_height
parse_style_tab_width
parse_style_text_color
parse_style_word_spacing
Parses a StyleWordSpacing attribute from a &str
strip_quotes
Strip quotes from an input, given that both quotes use either " or ', but not both.