Pseudo Classes

Reference for interactive state & structural pseudo-classes.

Active

Represents an element activated by the user (e.g., clicking a button).

Try clicking and holding the button to see the active state.
<button class="px-3 py-2 bg-indigo a:bg-indigo-7 c-white br-0">Press me</button>

Focus

Represents an element that received focus via click, tap, or the Tab key.

Try clicking on the input field to see how the border color and outline change.
<button class="px-3 py-2 bg-indigo c-white br-0 f:oc-indigo-4 f:oo-2 f:os-s f:ow-2">Click me</button>

Hover

Matches an element when the user interacts with it using a pointing device.

Try hovering over the button to see how the background color changes.
<button class="px-3 py-2 bg-indigo h:bg-indigo-7 c-white br-0 c-p">Hover me</button>

Focus Visible

Triggers when an element matches :focus & the browser determines focus should be evident.

Try using Tab to focus the button with your keyboard.
<button className="px-3 py-2 bg-indigo c-white br-0 c-p fv:ow-2 fv:oc-indigo-4 fv:oo-2">Focus me</button>

Focus Within

Matches an element if the element or any of its descendants are focused.

Try clicking on the input field to see the container's border change.
<div class="p-px bc-silver bw-2 fw:bc-indigo">
<input class="p-2 bc-silver bw-1" placeholder="Focus me" />
</div>

Checked

Represents radio, checkbox, or option elements toggled to an "on" state.

<input type="checkbox" class="w-4 h-4 br-0" checked />

Disabled

Represents disabled elements that cannot be activated or receive focus.

Elements with the disabled attribute use cursor: not-allowed by default in Base Styles.
<button class="px-3 py-2 bg-indigo-2 c-white br-0 d:bg-silver-4 d:c-silver-9" disabled>Disabled button</button>

Here's a reference for all the pseudo-variants available in Yumma CSS.

Pseudo-classPrefixDescription
:activea:*Applied when the element is being pressed
:checkedc:*Applied when a radio or checkbox is checked
:disabledd:*Applied when the element is disabled
:emptye:*Applied when the element has no children
:focusf:*Applied when the element receives focus
:focus-visiblefv:*Applied when focused via keyboard
:focus-withinfw:*Applied when element or child has focus
:hoverh:*Applied when the element is hovered
:first-childfc:*Applied when it's the first child
:invalidi:*Applied when the element value is invalid
:indeterminatein:*Applied when state is indeterminate
:last-childlc:*Applied when it's the last child
:nth-childnc:*Applied when matches nth-child(n)
:requiredr:*Applied when the element is required
:read-onlyro:*Applied when the element is read-only
:validv:*Applied when the element value is valid