staticdata.dev
Menu
Datasets About Contact

CSS Pseudo-Classes

78 CSS pseudo-classes curated from MDN Web Docs and the Selectors specifications, as of October 2026. Each entry includes the exact selector string (e.g. :hover, :nth-child()), a functional category such as state, structural, form, logical, linguistic, relational, shadow-dom, or paged-media, and a plain-English description of when and how the selector matches.

v1.0.0 MIT 78 records Updated 2026-10-05 stable Source:  MDN Web Docs — Pseudo-classes

Quick fetch

Stable URL. CORS-enabled. No auth.

bash
curl https://staticdata.dev/v1/css-pseudo-classes.json

Or use as a typed import: import { cssPseudoClasses } from "https://staticdata.dev/v1/css-pseudo-classes.ts"

Formats

  • JSON 13.9 KB

    /v1/css-pseudo-classes.json

    Open

    min: 12.0 KB · /v1/css-pseudo-classes.min.json

  • CSV 8.8 KB

    /v1/css-pseudo-classes.csv

    Open
  • TypeScript 14.1 KB

    /v1/css-pseudo-classes.ts

    export const cssPseudoClasses

    type PseudoClass = (typeof cssPseudoClasses)[number]

    Open

Schema

Each record in the dataset has the following shape.

Schema
Field Type Description Example
selector string CSS pseudo-class selector including leading colon :hover
category string Functional category of the pseudo-class state
description string Plain-English description of when the pseudo-class matches Matches an element when the user designates it with a pointing device, such as hovering over it with a mouse.

Preview

First 10 records.

Data preview
selectorcategorydescription
:activestateMatches an element that is being activated by the user, such as a link or button being clicked.
:active-view-transitionstateMatches the root element while a view transition is in progress.
:active-view-transition-type()stateMatches the root element while a view transition with one of the given transition types is in progress.
:any-linkstateMatches any element that acts as a hyperlink source anchor, regardless of whether it has been visited.
:autofillformMatches input elements that have been autofilled by the browser.
:blankformMatches input elements that have an empty value.
:bufferingstateMatches media elements that are playing but temporarily stopped because they are loading data.
:checkedformMatches radio, checkbox, or option elements that are checked or selected.
:currentstateMatches an element that is currently being displayed in a time-based media presentation (e.g., WebVTT cues).
:defaultformMatches form elements that are the default among a group of related elements (default button, default option, etc.).

Showing 10 of 78. View full data:  JSON · CSV

Fetch examples

Drop-in snippets in five languages.

curl
curl -sSL https://staticdata.dev/v1/css-pseudo-classes.json | jq '.[0]'
JavaScript
import type { PseudoClass } from "https://staticdata.dev/v1/css-pseudo-classes.ts";

const res = await fetch("https://staticdata.dev/v1/css-pseudo-classes.min.json");
if (!res.ok) throw new Error(`Fetch failed: ${res.status}`);
const cssPseudoClasses: PseudoClass[] = await res.json();
console.log(cssPseudoClasses[0]);
Python
import urllib.request, json

with urllib.request.urlopen("https://staticdata.dev/v1/css-pseudo-classes.min.json") as r:
    cssPseudoClasses = json.load(r)

print(cssPseudoClasses[0])
Go
package main

import (
	"encoding/json"
	"fmt"
	"net/http"
)

func main() {
	resp, err := http.Get("https://staticdata.dev/v1/css-pseudo-classes.min.json")
	if err != nil { panic(err) }
	defer resp.Body.Close()

	var data []map[string]any
	if err := json.NewDecoder(resp.Body).Decode(&data); err != nil {
		panic(err)
	}
	fmt.Println(data[0])
}
Rust
use serde_json::Value;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let body = ureq::get("https://staticdata.dev/v1/css-pseudo-classes.min.json").call()?.into_string()?;
    let data: Vec<Value> = serde_json::from_str(&body)?;
    println!("{:?}", data.first());
    Ok(())
}

Sources and methodology

This dataset is curated from MDN Web Docs, the authoritative reference for web standards maintained by Mozilla and contributors. It covers the pseudo-classes of CSS Selectors Level 3 and Level 4 and related specifications (Shadow DOM, paged media, media element states, view transitions, scroll markers), as of October 2026. Vendor-prefixed pseudo-classes are not included.

Each pseudo-class is assigned to one of eight functional categories: state (user-interaction states like :hover, :focus, :visited), structural (DOM-position selectors like :first-child, :nth-of-type()), form (form validation and input-state selectors like :valid, :required, :placeholder-shown), logical (combinators that reduce repetition like :is(), :not(), :where()), linguistic (language and directionality selectors like :lang(), :dir()), relational (context-aware selectors like :has(), :scope), shadow-dom (selectors for working inside Shadow DOM like :host, :state()), and paged-media (print-layout selectors like :first, :left, :right).

Functional pseudo-classes — those that accept arguments — are listed with empty parentheses in the selector field (e.g. :nth-child(), :is()) to indicate they require arguments at usage time. Experimental and draft-spec pseudo-classes with broad enough documentation on MDN (such as :popover-open, :user-valid, :state()) are included to give developers a complete reference.

Versioning

URLs under /v1/ are stable: field names and types will not change in a way that breaks consumers. Values can be corrected or records added when the upstream source changes; schema-incompatible updates ship under a new version path. See the css-pseudo-classes changelog for this dataset's history.

Related datasets

More Code datasets