Closed
Description
What version of Tailwind CSS are you using?
4.1.8
What operating system are you using?
macOS
Reproduction URL
@theme {
--color-label: rgb(from var(--color-label) r g b);
}
@utility color-scheme-light {
--color-label: black;
}
@utility color-scheme-dark {
--color-label: white;
}
@layer base {
@media (prefers-color-scheme: light) {
:root {
@apply color-scheme-light;
}
}
@media (prefers-color-scheme: dark) {
:root {
@apply color-scheme-dark;
}
}
}
Describe your issue
when porting the pattern above from Tailwind v3, i noticed that the Tailwind language server became caught in what appears to be an infinite loop.
building (with postcss
) still succeeds, and does not consume excessive resources.
the same behavior does not occur when using a different, non-shadowed, variable name.
@theme {
--color-label: rgb(from var(---color-label) r g b);
}
@utility color-scheme-light {
---color-label: black;
}
@utility color-scheme-dark {
---color-label: white;
}
if my assumption is correct, and the name shadowing is the root cause here, i would not mind if shadowing was flagged as an error.