SimpleSelector

sealed interface SimpleSelector(source)

a simple selector: a type, an id, a class, an attribute or a pseudo-class

Inheritors

Types

Link copied to clipboard
data class Attribute(val name: String, val operator: String? = null, val value: String? = null, val ignoreCase: Boolean = false) : SimpleSelector

An attribute selector: name is present, or its value relates to value by operator: =, ~=, |=, ^=, $= or *=

Link copied to clipboard
data class Class(val name: String) : SimpleSelector
Link copied to clipboard
data class Id(val name: String) : SimpleSelector
Link copied to clipboard
data class Logical(val name: String, val selectors: List<ComplexSelector>) : SimpleSelector

:not(), :is() and :where() of a list of selectors; :where() has no specificity

Link copied to clipboard
data class Nth(val a: Int, val b: Int, val fromEnd: Boolean, val ofType: Boolean) : SimpleSelector

:nth-child(an+b), :nth-last-child, :nth-of-type and :nth-last-of-type

Link copied to clipboard
data class PseudoClass(val name: String) : SimpleSelector

A pseudo-class without arguments: the structural ones, root, empty, first-child, last-child, only-child, first-of-type, last-of-type and only-of-type, and states, like hover, that the tree knows

Link copied to clipboard
data class Type(val name: String) : SimpleSelector
Link copied to clipboard

any node, *

Properties

Link copied to clipboard
abstract val specificity: Specificity

Functions

Link copied to clipboard
abstract fun <N> matches(node: N, tree: SelectorTree<N>): Boolean