Struct Selector

CSS element selector

struct Selector

Fields

TypeNameDescription
attributes List of attributes, [attr] variations from CSS
string[]
classes List of style classes, .class from CSS
combinator Combinator in complex selectors
enabledState State that is enabled, e.g. pressed|focused in :pressed:focused:not(checked)
string
id ID, #id from CSS
position Tree-Structural pseudo-class, e.g. :root or :first-child
previous Points to previous selector in the complex
uint[4]
specificity Selector specificity.
specifiedState State that is specified as :pseudo-class
string
subitem Subitem, ::pseudo-element from CSS
string
type Name of a widget or custom name
bool
universal True if this is a universal selector without id, state, etc.

Methods

NameDescription
calculateSpecificity () Calculate specificity of this selector
calculateUniversality () Compute universal property
validateAttrs () Check if attribute selectors can match something

Inner structs

NameDescription
Attr Attribute matcher

Enums

NameDescription
Combinator Combinator in complex selectors
TreePosition Tree-Structural pseudo-class, e.g. :root or :first-child