Parses the boolean selector value and creates an instance
of the BooleanSelector
class.
boolean selector value, e.g. foo:bar baz:not=qux
Helper selector that doesn't match any identifier on any level.
BooleanSelector
singleton
Helper selector that matches any identifier on any level.
BooleanSelector
singleton
Checks if current selector includes rules for the given top-level identifier.
identifier to look for
true
is current selector includes rules for the given identifier
Converts this selector to an attribute value.
attribute value for wildcard selectors (use attribute name here to be spec-compliant)
attribute value representing this selector.
Converts this selector to string.
serialized representation of this selector
Zooms on the given top-level identifier or follows a path.
path to look for
zoomed BooleanSelector
Creates a BooleanSelector
instance from an attribute value according to the following rules:
truthyValue
will be parsed as :not=*
;attribite value
additional attribute value that must be treated as truthy (use attribute name here to be spec-compliant)
BooleanSelector
instance constructed from the given attribite value
Generated using TypeDoc
Boolean selector is an HTML boolean attribute value format that allows developers to write configurations for elements deep in a shadow DOM. Here's what it looks like:
When used with the "disabled" attribute, the code above could translate to: "Disable everything except for the descendant-one and descendant-two in the nested-child that belongs to direct-child-one; disable direct-child-two entirely."
Boolean selector is always a list, where items are separated by whitespace (as much as you need, including line breaks):
Each item is a path that consists of identifiers (lowercase characters from a to z or a dash) separated by a colon:
By default, only specified paths will be selected. To select everything except for certain paths, add the
not=
modifier to the end of the path (or at the top level):You can specify multiple values by separating them with a comma and optionally a whitespace:
Only lowercase a-z letters, colon, comma, dash and whitespace are allowed in the selectors. An attempt to use a character outside of this set will result in a
SyntaxError
.