Usage

selector <- Selector$new()
selector <- css_sel()

selector$type(type_name)
selector$class(...)
selector$id(id_name)

new_selector <- selector$copy()

Methods

$type(type_name)

Set the type for the selector

type_nametype name

$id(id_name)

Set the id for the selector

id_nameid name

$class(...)

Add to the class list for for the selector

...class names

$attr(..., modifier = c('exact', 'choice', 'prefix', 'suffix', 'contains'))

Add attribute matching to the selector. See https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors

...name/value pairs for the atributes
modiferby default 'exact' attribute matching, but can select from among the different types of matching

$pseudo_class(...)

Set pseudo classes on the selector.

...Use name = TRUE to set pseudo-classes

$pseudo_element(...)

Set pseudo element on the selector.

...Use name = TRUE to set pseudo-elements

$descendant_of(selector), $parent_of(selector), $child_of(selector), $prior_adjacent(selector), $prior_sibling(selector), $and(selector)

Set relationship with another selector

selectorOther selector

$as_character()

Convert Selector to a character string.

$print()

Print Selector to terminal.

$copy()

Copy Selector.

Examples

if (FALSE) { selector <- css_sel(".marsha")$child_of('carol') }