Skip to content

Variable: CSSDOC_IDENTIFIER ​

ts
const CSSDOC_IDENTIFIER: Regex<"(?<identifier>[A-Za-z_][\\w-]*)", {
  names: {
     identifier: string;
  };
}>;

Defined in: packages/regex/src/tiers/css-doc-grammar.ts:28

CssDoc Identifier from grammar. Starts with ASCII letter or underscore; followed by word chars (ASCII) or hyphens. Grammar rule: Identifier :: IdentifierStart IdentifierPart*

Example ​

ts
CSSDOC_IDENTIFIER.exec("button")?.groups?.identifier // "button"
CSSDOC_IDENTIFIER.exec("my-component")?.groups?.identifier // "my-component"
CSSDOC_IDENTIFIER.exec("_private")?.groups?.identifier // "_private"

Released under the MIT License