TachyonUI 0.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
tachyon::StyleSheet Struct Reference

A parsed style sheet: named styles, custom properties and font faces. More...

#include <gui_core/style/gui_style_sheet.h>

Public Member Functions

bool HasErrors () const
 True when parsing reported any error.
const Style * GetStyle (std::string_view name) const
 The style of a class name (without the '.'); nullptr when not defined.
const CustomProperty * GetCustomProperty (std::string_view name) const
 A custom property by name (with the leading "--"); nullptr when not defined.

Public Attributes

std::unordered_map< std::string, Style > styles
 keyed by class name, without the '.
std::unordered_map< std::string, ChildStyles > childStyles
 The classes with :first-child / :last-child / :only-child rules; register them with StyleManager::RegisterWithChildStyles.
std::unordered_map< std::string, CustomProperty > customProperties
 keyed by name including the leading "--"
std::vector< FontFace > fontFaces
 in source order
Style baseStyle
 what * rules set; styles start from it
std::vector< ParseError > errors
 in the order found

Detailed Description

A parsed style sheet: named styles, custom properties and font faces.

Register a style with StyleManager::Register to use it.

Member Function Documentation

◆ HasErrors()

bool tachyon::StyleSheet::HasErrors ( ) const
inline

True when parsing reported any error.

◆ GetStyle()

const Style * tachyon::StyleSheet::GetStyle ( std::string_view name) const

The style of a class name (without the '.'); nullptr when not defined.

◆ GetCustomProperty()

const CustomProperty * tachyon::StyleSheet::GetCustomProperty ( std::string_view name) const

A custom property by name (with the leading "--"); nullptr when not defined.

Member Data Documentation

◆ styles

std::unordered_map<std::string, Style> tachyon::StyleSheet::styles

keyed by class name, without the '.

'

◆ childStyles

std::unordered_map<std::string, ChildStyles> tachyon::StyleSheet::childStyles

The classes with :first-child / :last-child / :only-child rules; register them with StyleManager::RegisterWithChildStyles.

◆ customProperties

std::unordered_map<std::string, CustomProperty> tachyon::StyleSheet::customProperties

keyed by name including the leading "--"

◆ fontFaces

std::vector<FontFace> tachyon::StyleSheet::fontFaces

in source order

◆ baseStyle

Style tachyon::StyleSheet::baseStyle

what * rules set; styles start from it

◆ errors

std::vector<ParseError> tachyon::StyleSheet::errors

in the order found


The documentation for this struct was generated from the following file: