Expand description
Provides a reference implementation of a style parser for Azul, capable of parsing CSS
stylesheets into their respective Css counterparts.
Structs§
- CssParse
Error - Error that can happen during the parsing of a CSS value
- CssParse
Warn Msg - Error
Location - HotReloader
- Allows dynamic reloading of a CSS file at application runtime.
- Invalid
Value Err - Simple “invalid value” error, used for
- Layout
Margin - Represents a parsed
paddingattribute - Layout
Padding - Represents a parsed
paddingattribute - Quote
Stripped - A string that has been stripped of the beginning and ending quote
- Style
Border Radius - Unclosed
Quotes Error - String has unbalanced
'or"quotation marks - Unparsed
CssRule Block
Enums§
- CssBackground
Parse Error - CssBackground
Position Parse Error - CssBorder
Parse Error - CssColor
Component - CssColor
Parse Error - CssDirection
Corner Parse Error - CssDirection
Parse Error - CssGradient
Stop Parse Error - CssImage
Parse Error - CssParse
Error Inner - CssParse
Warn MsgInner - CssParsing
Error - Error containing all sub-errors that could happen during CSS parsing
- CssPath
Parse Error - CssPseudo
Selector Parse Error - CssShadow
Parse Error - CssShape
Parse Error - CssStyle
Border Radius Parse Error - CssStyle
Font Family Parse Error - CssSyntax
Error - List of all supported errors.
- Dynamic
CssParse Error - Error that can happen during
css_parser::parse_key_value_pair - Flex
Grow Parse Error - Flex
Shrink Parse Error - Layout
Margin Parse Error - Layout
Padding Parse Error - Parenthesis
Parse Error - Percentage
Parse Error - Pixel
Parse Error - Pixel
Value With Auto
Constants§
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]), orrgba([0-255], [0-255], [0-255], [0.0-1.0])without the leadingrgb[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
directionsuch 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
LayoutAlignContentattribute from a&str - parse_
layout_ align_ items - Parses a
LayoutAlignItemsattribute from a&str - parse_
layout_ bottom - Parses a
LayoutBottomattribute from a&str - parse_
layout_ box_ sizing - Parses a
LayoutBoxSizingattribute from a&str - parse_
layout_ direction - Parses a
LayoutDirectionattribute from a&str - parse_
layout_ display - Parses a
LayoutDisplayattribute from a&str - parse_
layout_ flex_ grow - parse_
layout_ flex_ shrink - parse_
layout_ float - Parses a
LayoutFloatattribute from a&str - parse_
layout_ height - Parses a
LayoutHeightattribute from a&str - parse_
layout_ justify_ content - Parses a
LayoutJustifyContentattribute from a&str - parse_
layout_ left - Parses a
LayoutLeftattribute from a&str - parse_
layout_ margin - parse_
layout_ margin_ bottom - Parses a
LayoutMarginBottomattribute from a&str - parse_
layout_ margin_ left - Parses a
LayoutMarginLeftattribute from a&str - parse_
layout_ margin_ right - Parses a
LayoutMarginRightattribute from a&str - parse_
layout_ margin_ top - Parses a
LayoutMarginTopattribute from a&str - parse_
layout_ max_ height - Parses a
LayoutMaxHeightattribute from a&str - parse_
layout_ max_ width - Parses a
LayoutMaxWidthattribute from a&str - parse_
layout_ min_ height - Parses a
LayoutMinHeightattribute from a&str - parse_
layout_ min_ width - Parses a
LayoutMinWidthattribute from a&str - parse_
layout_ overflow - Parses a
Overflowattribute from a&str - parse_
layout_ padding - Parse a padding value such as
- parse_
layout_ padding_ bottom - Parses a
LayoutPaddingBottomattribute from a&str - parse_
layout_ padding_ left - Parses a
LayoutPaddingLeftattribute from a&str - parse_
layout_ padding_ right - Parses a
LayoutPaddingRightattribute from a&str - parse_
layout_ padding_ top - Parses a
LayoutPaddingTopattribute from a&str - parse_
layout_ position - Parses a
LayoutPositionattribute from a&str - parse_
layout_ right - Parses a
LayoutRightattribute from a&str - parse_
layout_ text_ align - Parses a
StyleTextAlignmentHorzattribute from a&str - parse_
layout_ top - Parses a
LayoutTopattribute from a&str - parse_
layout_ width - Parses a
LayoutWidthattribute from a&str - parse_
layout_ wrap - Parses a
LayoutWrapattribute 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
Shapeattribute from a&str - parse_
style_ background_ content - parse_
style_ background_ position - parse_
style_ background_ repeat - Parses a
StyleBackgroundRepeatattribute from a&str - parse_
style_ background_ size - Parses a
StyleBackgroundSizeattribute from a&str - parse_
style_ border - Parse a CSS border such as
- parse_
style_ border_ bottom_ left_ radius - Parses a
StyleBorderBottomLeftRadiusattribute from a&str - parse_
style_ border_ bottom_ right_ radius - Parses a
StyleBorderBottomRightRadiusattribute from a&str - parse_
style_ border_ bottom_ width - Parses a
StyleBorderBottomWidthattribute from a&str - parse_
style_ border_ left_ width - Parses a
StyleBorderLeftWidthattribute 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
StyleBorderRightWidthattribute from a&str - parse_
style_ border_ style - Parses a
BorderStyleattribute from a&str - parse_
style_ border_ top_ left_ radius - Parses a
StyleBorderTopLeftRadiusattribute from a&str - parse_
style_ border_ top_ right_ radius - Parses a
StyleBorderTopRightRadiusattribute from a&str - parse_
style_ border_ top_ width - Parses a
StyleBorderTopWidthattribute from a&str - parse_
style_ box_ shadow - Parses a CSS box-shadow, such as “5px 10px inset”
- parse_
style_ cursor - Parses a
StyleCursorattribute from a&str - parse_
style_ font_ family - Parses a
StyleFontFamilydeclaration from a&str - parse_
style_ font_ size - Parses a
StyleFontSizeattribute from a&str - parse_
style_ letter_ spacing - Parses a
StyleLetterSpacingattribute from a&str - parse_
style_ line_ height - parse_
style_ tab_ width - parse_
style_ text_ color - parse_
style_ word_ spacing - Parses a
StyleWordSpacingattribute from a&str - strip_
quotes - Strip quotes from an input, given that both quotes use either
"or', but not both.