========================= Universal selectors ========================= * {} --- (stylesheet (rule_set (selectors (universal_selector)) (block))) ========================= Type selectors ========================= div, span {} --- (stylesheet (rule_set (selectors (tag_name) (tag_name)) (block))) ========================= Class selectors ========================= .class-a {} div.class-b, .class-c.class-d {} --- (stylesheet (rule_set (selectors (class_selector (class_name))) (block)) (rule_set (selectors (class_selector (tag_name) (class_name)) (class_selector (class_selector (class_name)) (class_name))) (block))) ========================= Id selectors ========================= #some-id, a#another-id {} --- (stylesheet (rule_set (selectors (id_selector (id_name)) (id_selector (tag_name) (id_name))) (block))) ========================= Attribute selectors ========================= [a] {} [b=c] {} [d~=e] {} a[b] {} --- (stylesheet (rule_set (selectors (attribute_selector (attribute_name))) (block)) (rule_set (selectors (attribute_selector (attribute_name) (keyword_value))) (block)) (rule_set (selectors (attribute_selector (attribute_name) (keyword_value))) (block)) (rule_set (selectors (attribute_selector (tag_name) (attribute_name))) (block))) ========================= Pseudo-class selectors ========================= a:hover {} :nth-child(2) {} --- (stylesheet (rule_set (selectors (pseudo_class_selector (tag_name) (class_name))) (block)) (rule_set (selectors (pseudo_class_selector (class_name) (arguments (integer_value)))) (block))) ========================= Pseudo-element selectors ========================= a::first-line {} --- (stylesheet (rule_set (selectors (pseudo_element_selector (tag_name) (tag_name))) (block))) ========================= Child selectors ========================= a > b {} c > d > e {} --- (stylesheet (rule_set (selectors (child_selector (tag_name) (tag_name))) (block)) (rule_set (selectors (child_selector (child_selector (tag_name) (tag_name)) (tag_name))) (block))) ========================= Descendant selectors ========================= a b {} c d e {} --- (stylesheet (rule_set (selectors (descendant_selector (tag_name) (tag_name))) (block)) (rule_set (selectors (descendant_selector (descendant_selector (tag_name) (tag_name)) (tag_name))) (block))) =========================== Nesting selectors =========================== a { &.b {} & c {} & > d {} } --- (stylesheet (rule_set (selectors (tag_name)) (block (rule_set (selectors (class_selector (nesting_selector) (class_name))) (block)) (rule_set (selectors (descendant_selector (nesting_selector) (tag_name))) (block)) (rule_set (selectors (child_selector (nesting_selector) (tag_name))) (block)))))