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
padding
attribute - Layout
Padding - Represents a parsed
padding
attribute - 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
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.