Crate bevy_flair_css_parser

Crate bevy_flair_css_parser 

Source
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.
CssErrorCode
Represents a pair of code and message for a CSS error. Errors will be reported like "[$code] $message:
CssStyleLoaderSetting
Per-stylesheet settings for CssStyleSheetLoader.
CssStyleSheetLoader
An AssetLoader for CSS stylesheets stored in external .css files.
ErrorReportGenerator
A helper struct to generate error reports out of CssError. It uses the ariadne crate to generate the error report.
FlairCssParserPlugin
Add support for css parsing infrastructure.
InlineCssStyleSheetParser
A helper system parameter for parsing inline CSS stylesheets directly from string contents.
InlineStyle
Represents a collection of CSS inline style properties.
Located
Wrapper for a value that has a location in a byte range
ReflectParseCss
[bevy::reflect::TypeData] for parsing a CSS type.
ReflectParseCssEnum
[bevy::reflect::TypeData] for parsing a CSS type when the type is an enum. It’s automatically implemented to all Enum types.
ShorthandProperty
Represents a single shorthand property.
ShorthandPropertyRegistry
Resource that stores registered shorthand properties.

Enums§

CssStyleLoaderError
Errors that can occur while loading a CSS stylesheet using CssStyleSheetLoader or InlineCssStyleSheetParser.
CssStyleLoaderErrorMode
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.
ParserExt
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§

PropertyValueParseFn
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 a CssError.
ShorthandParseFn
Function signature used to parse a CSS shorthand property into multiple component properties.
ShorthandParseResult
Type of result expected from a shorthand parse function.