MCPcopy
hub / github.com/tailwindlabs/tailwindcss / onCircularDependency

Function onCircularDependency

packages/tailwindcss/src/index.ts:631–641  ·  view source on GitHub ↗
(path, start)

Source from the content-addressed store, hash-verified

629 // Register custom variants in order
630 for (let variant of topologicalSort(customVariantDependencies, {
631 onCircularDependency(path, start) {
632 let output = toCss(
633 path.map((name, idx) => {
634 return atRule('@custom-variant', name, [atRule('@variant', path[idx + 1] ?? start, [])])
635 }),
636 )
637 .replaceAll(';', ' { … }')
638 .replace(`@custom-variant ${start} {`, `@custom-variant ${start} { /* ← */`)
639
640 throw new Error(`Circular dependency detected in custom variants:\n\n${output}`)
641 },
642 })) {
643 customVariants.get(variant)?.(designSystem)
644 }

Callers

nothing calls this directly

Calls 2

toCssFunction · 0.90
atRuleFunction · 0.90

Tested by

no test coverage detected