=========================
Universal selectors
=========================

* {}

---

(stylesheet
  (rule_set (selectors (universal_selector)) (block)))

=========================
Type selectors
=========================

div, span {}
h1, h2, h3, h4 {}

---

(stylesheet
  (rule_set (selectors (tag_name) (tag_name)) (block))
  (rule_set (selectors (tag_name) (tag_name) (tag_name) (tag_name)) (block)))

=========================
Class selectors
=========================

.class-a {}
div.class-b, .class-c.class-d {}

---

(stylesheet
  (rule_set
    (selectors (class_selector (class_name (identifier))))
    (block))
  (rule_set
    (selectors
      (class_selector (tag_name) (class_name (identifier)))
      (class_selector (class_selector (class_name (identifier))) (class_name (identifier))))
    (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) (plain_value))) (block))
  (rule_set (selectors (attribute_selector (attribute_name) (plain_value))) (block))
  (rule_set (selectors (attribute_selector (tag_name) (attribute_name))) (block)))

=========================
Pseudo-class selectors
=========================

a:hover {}
:nth-child(2) {}
p:has(li) {}
p:is(.foo) {}
p:has(li.foo) {}
*:where(li#foo) {}
p:has(.foo, .bar) {}
a:not([href]) {}
:host([a="b"]:hover) {}
:host([a='b']:hover) {}
:host {}
:host { display: block; }
:host(div.foo) {}
:nth-child(2n of a.external) {}
---

(stylesheet
  (rule_set
    (selectors (pseudo_class_selector (tag_name) (class_name (identifier))))
    (block))
  (rule_set
    (selectors (pseudo_class_selector (class_name) (arguments (integer_value))))
    (block))
  (rule_set
    (selectors (pseudo_class_selector (tag_name) (class_name) (arguments (tag_name))))
    (block))
  (rule_set
    (selectors (pseudo_class_selector (tag_name) (class_name) (arguments (class_selector (class_name (identifier))))))
    (block))
  (rule_set
    (selectors (pseudo_class_selector (tag_name) (class_name) (arguments (class_selector (tag_name) (class_name (identifier))))))
    (block))
  (rule_set
    (selectors (pseudo_class_selector (universal_selector) (class_name) (arguments (id_selector (tag_name) (id_name)))))
    (block))
  (rule_set
    (selectors (pseudo_class_selector (tag_name) (class_name) (arguments (class_selector (class_name (identifier))) (class_selector (class_name (identifier))))))
    (block))
  (rule_set
    (selectors (pseudo_class_selector (tag_name) (class_name) (arguments (attribute_selector (attribute_name)))))
    (block))
  (rule_set
    (selectors (pseudo_class_selector (class_name) (arguments (pseudo_class_selector (attribute_selector (attribute_name) (string_value (string_content))) (class_name (identifier))))))
    (block))
  (rule_set
    (selectors (pseudo_class_selector (class_name) (arguments (pseudo_class_selector (attribute_selector (attribute_name) (string_value (string_content))) (class_name (identifier))))))
    (block))
  (rule_set
    (selectors (pseudo_class_selector (class_name)))
    (block))
  (rule_set
    (selectors (pseudo_class_selector (class_name)))
    (block (declaration (property_name) (plain_value))))
  (rule_set
    (selectors (pseudo_class_selector (class_name) (arguments (class_selector (tag_name) (class_name (identifier))))))
    (block))
  (rule_set
    (selectors (pseudo_class_selector (class_name) (arguments (plain_value) (class_selector (tag_name) (class_name (identifier))))))
    (block)))

=========================
:nth-child and :nth-last-child selectors
=========================

:nth-child(2) {}
:nth-last-child(-n) {}
:nth-last-child(2n+1) {}
:nth-child(2n + 2) {}
:nth-last-child(-n) {}
:nth-child(2n of a.external) {}
---

(stylesheet
  (rule_set
    (selectors (pseudo_class_selector (class_name) (arguments (integer_value))))
    (block))
  (rule_set
    (selectors (pseudo_class_selector (class_name) (arguments (plain_value))))
    (block))
  (rule_set
    (selectors (pseudo_class_selector (class_name) (arguments (plain_value))))
    (block))
  (rule_set
    (selectors (pseudo_class_selector (class_name) (arguments (plain_value))))
    (block))
  (rule_set
    (selectors (pseudo_class_selector (class_name) (arguments (plain_value))))
    (block))
  (rule_set
    (selectors (pseudo_class_selector (class_name) (arguments (plain_value) (class_selector (tag_name) (class_name (identifier))))))
    (block))
)

=========================
Pseudo-element selectors
=========================

a::first-line {}

---

(stylesheet
  (rule_set
    (selectors (pseudo_element_selector (tag_name) (tag_name)))
    (block)))

=========================
::slotted pseudo element
=========================

::slotted(button) {}

---

(stylesheet
  (rule_set
    (selectors (pseudo_element_selector (tag_name)
      (arguments (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 {}
f * {}

---

(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))
  (rule_set
    (selectors
      (descendant_selector
        (tag_name)
        (universal_selector)))
    (block)))

===========================
Nesting selectors
===========================

a {
  &.b {}
  & c {}
  & > d {}
}

---

(stylesheet
  (rule_set
    (selectors (tag_name))
    (block
      (rule_set (selectors (class_selector (nesting_selector) (class_name (identifier)))) (block))
      (rule_set (selectors (descendant_selector (nesting_selector) (tag_name))) (block))
      (rule_set (selectors (child_selector (nesting_selector) (tag_name))) (block)))))

===========================
Sibling selectors
===========================

a.b ~ c.d {}
.e.f + .g.h {}

---

(stylesheet
  (rule_set
    (selectors (sibling_selector
      (class_selector (tag_name) (class_name (identifier)))
      (class_selector (tag_name) (class_name (identifier)))))
    (block))
  (rule_set
    (selectors (adjacent_sibling_selector
      (class_selector (class_selector (class_name (identifier))) (class_name (identifier)))
      (class_selector (class_selector (class_name (identifier))) (class_name (identifier)))))
    (block)))

===========================
The :not selector
===========================

a:not(:hover) {}
.b:not(c > .d) {}

---

(stylesheet
  (rule_set
    (selectors (pseudo_class_selector
      (tag_name)
      (class_name)
      (arguments (pseudo_class_selector (class_name (identifier))))))
    (block))
  (rule_set
    (selectors (pseudo_class_selector
      (class_selector (class_name (identifier)))
      (class_name)
      (arguments (child_selector (tag_name) (class_selector (class_name (identifier)))))))
    (block)))

===========================
Nested combinators
===========================

.parent {
	>p {}
	>* {}
	~div {}
	+p {}
	space-element {}
	| ns-element {}
}

---

(stylesheet
  (rule_set
    (selectors
      (class_selector
        (class_name
          (identifier))))
    (block
      (rule_set
        (selectors
          (child_selector
            (tag_name)))
        (block))
      (rule_set
        (selectors
          (child_selector
            (universal_selector)))
        (block))
      (rule_set
        (selectors
          (sibling_selector
            (tag_name)))
        (block))
      (rule_set
        (selectors
          (adjacent_sibling_selector
            (tag_name)))
        (block))
      (rule_set
        (selectors
          (tag_name))
        (block))
      (rule_set
        (selectors
          (namespace_selector
            (tag_name)))
        (block)))))

===================
Escape sequences
===================

.hover\:bg-blue-600::before {
	content: "\f123";
}

.a\.5 {}

---

(stylesheet
  (rule_set
    (selectors
      (pseudo_element_selector
        (class_selector
          (class_name
            (identifier)
            (escape_sequence)
            (identifier)))
        (tag_name)))
    (block
      (declaration
        (property_name)
        (string_value
          (escape_sequence)))))
  (rule_set
    (selectors
      (class_selector
        (class_name
          (identifier)
          (escape_sequence)
          (identifier))))
    (block)))
