Skip to content

Variable: PSEUDO_CLASS ​

ts
const PSEUDO_CLASS: Regex<":(?<name>[\\w-]+)(?:\\((?<arg>[^)]*)\\))?", {
  flags: "u";
  names: {
     arg?: string;
     name: string;
  };
}>;

Defined in: packages/regex/src/tiers/cssdoc-local.ts:143

Pseudo-Class Pattern Matches pseudo-class selectors like :hover, :focus, :not(...) Used for state and hover/focus condition extraction.

Example ​

ts
PSEUDO_CLASS.exec(":hover")?.groups?.name // "hover"
PSEUDO_CLASS.exec(":not(.disabled)")?.groups?.name // "not"
PSEUDO_CLASS.exec(":not(.disabled)")?.groups?.arg // ".disabled"

Released under the MIT License