Expand description
§Bevy Flair CSS Parser
Includes a CSS parser and a Bevy plugin for parsing CSS files as assets.
Structs§
- CssError
- Represents a located error that happened while parsing CSS.
This class is meant to be an improvement over
ParseError
in 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:
- CssStyle
Loader Setting - Per-stylesheet settings for
CssStyleSheetLoader
. - CssStyle
Sheet Loader - An
AssetLoader
for CSS stylesheets stored in external.css
files. - Error
Report Generator - A helper struct to generate error reports out of
CssError
. It uses theariadne
crate 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
- Reflect
Parse Css - [
bevy::reflect::TypeData
] for parsing a CSS type. - Reflect
Parse CssEnum - [
bevy::reflect::TypeData
] for parsing a CSS type when the type is an enum. It’s automatically implemented to allEnum
types. - 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
CssStyleSheetLoader
orInlineCssStyleSheetParser
. - CssStyle
Loader Error Mode - Different ways to handle css errors
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_
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_
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.