shadcn-ui/lint's `parseDeclarations` function, specifically its CSS comment stripping regex and its impact on theme parsing and the `no-arbitrary-values` rule.
Raw Developer Origin & Technical Request
GitHub Issue
Sep 14, 2026
## Summary
`parseDeclarations` strips CSS comments with `css.replace(/\/\*[\s\S]*?\*\//g, "")` before scanning for `--*` declarations. That regex does not know about string literals, so the `/*` inside a Tailwind `@source` glob such as
```css
@source "../node_modules/streamdown/dist/*.js";
```
is treated as a comment opener. Everything up to the next real `*/` in the file is discarded, which in a typical `globals.css` means the `@theme inline { … }` block and the `:root { --radius: … }` declaration.
The theme then silently falls back to Tailwind's default scale, and `no-arbitrary-values` reports *exact* replacements that are wrong for the project. Applying them via `--fix-suggestions` changes rendered output.
The `@source` line above is the one [streamdown's README](github.com/vercel/streamdown tells every user to add, so this is likely to hit anyone using it with a `calc(var(--radius) …)` ladder.
## Reproduction
`app/globals.css`:
```css
@import "tailwindcss";
@source "../node_modules/some-pkg/dist/*.js";
@theme inline {
--radius-sm: calc(var(--radius) - 4px);
--radius-md: calc(var(--radius) - 2px);
--radius-lg: var(--radius);
--radius-xl: calc(var(--radius) + 4px);
}
:root {
--radius: 0.375rem; /* 6px */
}
```
`page.tsx`:
```tsx
export default function P() {
return ;
}
```
With `"shadcn/no-arbitrary-values": "error"`:
```
"rounded-[8px]" hardcodes an off-token value. Use "rounded-lg" instead (s...
Developer Debate & Comments
No active discussions extracted for this entry yet.
Adjacent Repository Pain Points
Other highly discussed features and pain points extracted from shadcn-ui/lint.
Frequently Asked Questions
Market intelligence mapped to shadcn-ui/lint's `parseDeclarations` function, specifically its CSS comment stripping regex and its impact on theme parsing and the `no-arbitrary-values` rule..
What problem does shadcn-ui/lint's `parseDeclarations` function, specifically its CSS comment stripping regex and its impact on theme parsing and the `no-arbitrary-values` rule. solve?
What are the foundational technologies related to shadcn-ui/lint's `parseDeclarations` function, specifically its CSS comment stripping regex and its impact on theme parsing and the `no-arbitrary-values` rule.?
How does the GitHub community build with shadcn-ui/lint's `parseDeclarations` function, specifically its CSS comment stripping regex and its impact on theme parsing and the `no-arbitrary-values` rule.?
Engagement Signals
Cross-Market Term Frequency
Quantifies the cross-market adoption of foundational terms like regex and @theme inline by tracking occurrence frequency across active SaaS architectures and enterprise developer debates.
SaaS Metrics