A part of structured CSS selector.

It may represent a selector like element-name#id.class1.classN[attr1][attr2]:pseudo-class::pseudo-element with any of sub-parts omitted. Attributes, pseudo-classes, and pseudo-elements are represented as sub-selectors. A raw CSS selector can also be represented by this structure, but is never parsed.

All of the properties are optional.

Hierarchy

Properties

Properties

$?: string | readonly string[]

Qualifier or qualifiers.

Qualifiers are typically not rendered as CSS selector text, but rather used to distinguish between style rules.

Qualifier may have a name=value form. The name part may be qualified by separating name parts with colons.

Example: foo:bar:baz=some value matches foo:bar:baz=some value, foo:bar:baz, foo:bar, and foo.

c?: QualifiedName | readonly QualifiedName[]

Element class name or names.

e?: QualifiedName

Element name.

This is the same as * when absent. Unless the part contains only sub-selectors, and the first one is either a pseudo-class or a pseudo-element.

i?: QualifiedName

Element identifier.

ns?: string | NamespaceDef

Element namespace.

s?: string

Raw CSS selector text to append to the end.

When all other properties are omitted this one represents a raw CSS selector text. Otherwise it is appended to other selector parts representation.

Sub-selector(s) representing either attribute selector, pseudo-class, or pseudo-element.

Generated using TypeDoc