Skip to content

Variable: CUSTOM_STATE ​

ts
const CUSTOM_STATE: Regex<":state\\((?<name>[A-Za-z_][\\w-]*)\\)", {
  flags: "u";
  names: {
     name: string;
  };
}>;

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

Custom State Pseudo-Class Pattern Matches :state(name) for custom element state styling. Used to extract custom state name.

Example ​

ts
CUSTOM_STATE.exec(":state(selected)")?.groups?.name // "selected"

Released under the MIT License