Skip to content

Variable: VAR_REFERENCE ​

ts
const VAR_REFERENCE: Regex<"var\\(\\s*(?<name>--[\\w-]+)", {
  flags: "gu";
  names: {
     name: string;
  };
}>;

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

Custom Property Variable Reference Pattern Matches var(--name) patterns. Used to track consumed custom properties.

Example ​

ts
VAR_REFERENCE.exec("var(--primary-color)")?.groups?.name // "--primary-color"

Released under the MIT License