Expand description
§Bevy Flair CSS Parser
Includes a CSS parser and a Bevy plugin for parsing CSS files as assets.
Re-exports§
pub use cssparser;
Structs§
- Basic
Parse Error - The fundamental parsing errors that can be triggered by built-in parsing routines.
- CowRc
Str - A string that is either shared (heap-allocated and reference-counted) or borrowed.
- CssError
- Represents a located error that happened while parsing CSS.
This class is meant to be an improvement over
ParseErrorin order to provide better error reporting. - CssError
Code - Represents a pair of code and message for a CSS error.
Errors will be reported like
"[$code] $message: - CssRef
- Reference to a CSS property name.
- CssStyle
Loader Setting - Per-stylesheet settings for
CssStyleSheetLoader. - CssStyle
Sheet Loader - An
AssetLoaderfor CSS stylesheets stored in external.cssfiles. - Error
Report Generator - A helper struct to generate error reports out of
CssError. It uses theariadnecrate to generate the error report. - Flair
CssParser Plugin - Add support for css parsing infrastructure.
- Inline
CssStyle Sheet Parser - A helper system parameter for parsing inline CSS stylesheets directly from string contents.
- Inline
Style - Represents a collection of CSS inline style properties.
- Located
- Wrapper for a value that has a location in a byte range
- Parser
- A CSS parser that borrows its
&strinput, yieldsTokens, and keeps track of nested blocks and functions. - Reflect
Parse Css bevy_reflect::TypeDatafor parsing a CSS type.- Reflect
Parse CssEnum bevy_reflect::TypeDatafor parsing a CSS type when the type is an enum. It’s automatically implemented to allEnumtypes.- Shorthand
Property - Represents a single shorthand property.
- Shorthand
Property Registry - Resource that stores registered shorthand properties.
Enums§
- CssStyle
Loader Error - Errors that can occur while loading a CSS stylesheet using
CssStyleSheetLoaderorInlineCssStyleSheetParser. - CssStyle
Loader Error Mode - Different ways to handle css errors
- Token
- One of the pieces the CSS input is broken into.
Traits§
- CalcAdd
- A trait for values that support addition and subtraction inside CSS
calc()expressions. - CalcMul
- A trait for values that can be multiplied by a floating-point scalar
inside a CSS
calc()expression. - Calculable
- A trait for values that can be used inside CSS
calc()expressions. - Parser
Ext - Convenience methods over
Parser. Main use case is to get the location of the parsed item.
Functions§
- parse_
asset_ path - Parses an asset path for the given asset type
A. This function expects either aurl("path")or a string"path"in the CSS. The returned value is anAssetPathPlaceholder<A>which needs to converted to aHandle<A>later. - parse_
calc_ property_ value_ with - Parses a CSS property value that may use
calc()expressions or global keywords. - parse_
calc_ value - Parses a CSS
calc()expression or raw value, and computes its result immediately. - parse_
color - Parses a CSS color value into a Bevy
Color. - parse_
duration - Parses a
Durationfrom a CSS token. - parse_
property_ value_ with - Parses a CSS property value that may be either a global keyword or a typed value.
- parse_
val - Parses a
Val(UI length/size value) from a CSS token.
Type Aliases§
- Property
Value Parse Fn - A function that parses a CSS type.
When the function succeeds, it should return a
bevy_flair_core::ReflectValue. When the function fails, it should return aCssError. - Shorthand
Parse Fn - Function signature used to parse a CSS shorthand property into multiple component properties.
- Shorthand
Parse Result - Type of result expected from a shorthand parse function.