Skip to content

pantoken / packages/utils/src / danglingReferences

फंक्शन: danglingReferences()

danglingReferences(css): string[]

बीटा

स्व-निहितता जांच: उन --instui-* नामों को जिनका stylesheet में var() के माध्यम से संदर्भ लिया गया है परंतु वह stylesheet उन्हें कभी परिभाषित नहीं करता (न तो @property पंजीकरण के रूप में और न ही --x: घोषणा के रूप में)। क्रमबद्ध; खाली होना मतलब है कि प्रत्येक संदर्भ उसी आउटपुट के भीतर हल हो जाता है। स्व-निहित stylesheets (css, pendo) के लिए उपयोग करें।

पैरामीटर

css

string

जनरेट की गई स्टाइलशीट।

वापसी

string[]

लटकते हुए संदर्भ नाम।

उदाहरण

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"]