Donner
C++20 SVG rendering library
Loading...
Searching...
No Matches
donner::css::parser::DeclarationListParser Class Reference

Parse a CSS declaration list, which can be either from an HTML/SVG style attribute, or from the list of component values from within a rule. More...

#include "donner/css/parser/DeclarationListParser.h"

Static Public Member Functions

static std::vector< DeclarationOrAtRuleParse (std::string_view str)
 Parse a HTML/SVG style attribute, corresponding to a CSS <declaration-list>.
 
static std::vector< DeclarationParseOnlyDeclarations (std::string_view str)
 Parse a HTML/SVG style attribute, corresponding to a CSS <declaration-list>, but only returns the list of declarations, skipping any at-rules when parsing.
 
static std::vector< DeclarationParseRuleDeclarations (std::span< ComponentValue > components)
 Parse a list of component values, from a Rule definition, corresponding to a CSS <declaration-list>.
 

Detailed Description

Parse a CSS declaration list, which can be either from an HTML/SVG style attribute, or from the list of component values from within a rule.

For example, the following is a valid declaration list:

color: red; background-color: blue; font-size: 12px;
A parser result, which may contain a result of type T, or an error, or both.
Definition ParseResult.h:17

Member Function Documentation

◆ Parse()

std::vector< DeclarationOrAtRule > donner::css::parser::DeclarationListParser::Parse ( std::string_view str)
static

Parse a HTML/SVG style attribute, corresponding to a CSS <declaration-list>.

Parameters
strInput string.
Returns
Parsed declaration list.

◆ ParseOnlyDeclarations()

std::vector< Declaration > donner::css::parser::DeclarationListParser::ParseOnlyDeclarations ( std::string_view str)
static

Parse a HTML/SVG style attribute, corresponding to a CSS <declaration-list>, but only returns the list of declarations, skipping any at-rules when parsing.

Parameters
strInput string.
Returns
Parsed declaration list.

◆ ParseRuleDeclarations()

std::vector< Declaration > donner::css::parser::DeclarationListParser::ParseRuleDeclarations ( std::span< ComponentValue > components)
static

Parse a list of component values, from a Rule definition, corresponding to a CSS <declaration-list>.

Parameters
componentsList of component values.
Returns
Parsed declaration list.

The documentation for this class was generated from the following files: