Skip to content

pantoken / packages/utils/src / danglingReferences

Fušla: danglingReferences()

danglingReferences(css): string[]

Behta

Omasatnečoahkkimis: --instui-*-nammat mii sáhttet árvot var()-dihtii stylesheeatmas mii ii leat muhto dáhpáhus (nugo @property-registrerejuvvon dahje --x:-dálkádus). Lávvosttá; eanet lea ovttas buot referenssat čuojahit same outputis. Geavahit ovttas-muhtun stylesheettaid (css, pendo).

Parametera

css

string

Guhkkin stylesheeatma.

Gullii / Gávdnat

string[]

Logaheapmi referensnammat.

Exempel

ts
import { danglingReferences } from "@pantoken/utils";

// Self-contained: the referenced property is also defined here.
danglingReferences("@property --instui-a {} .b { color: var(--instui-a); }"); // → []

// Dangling: `--instui-b` is referenced but never defined.
danglingReferences(
  ":root { --instui-a: red; } .b { color: var(--instui-a); background: var(--instui-b); }",
); // → ["--instui-b"]