shadcn-ui/lint's `no-raw-colors` rule and its compatibility with Tailwind v4's namespaced color theme keys.
Raw Developer Origin & Technical Request
GitHub Issue
Sep 14, 2026
### What happens
`no-raw-colors` builds its set of declared tokens from `@theme` declarations whose name starts with `color-` (`applyTokenDeclarations` in `dist/index.js`). Tailwind v4 also accepts colors under the scoped namespaces `--background-color-*`, `--text-color-*`, and `--border-color-*`, and generates `bg-` / `text-` / `border-` from them.
In a theme that declares its semantic colors that way, every semantic utility is reported as "not a declared theme color", and the suggestion list is the raw primitive palette the theme meant to hide behind those semantics.
### Minimal reproduction
```css
@import "tailwindcss";
@theme static {
--color-*: initial;
--color-gray-500: #6b7280;
}
:root {
--surface: var(--color-gray-500);
}
@theme inline {
--background-color-surface: var(--surface);
}
```
```tsx
// reported: "bg-surface" is not a declared theme color. Use one of: gray-500 ...
// passes (declared under --color-*)
```
Tailwind itself generates `bg-surface`: `__unstable__loadDesignSystem(css).candidatesToCss(['bg-surface'])` returns `.bg-surface { background-color: var(--surface); }`.
### Related: `no-unknown-classes` defers color classes
`no-unknown-classes` skips an unknown class in the color category when the Tailwind worker returns no spelling suggestion, leaving the verdict to `no-raw-colors`. A project that has to turn `no-raw-colors` off for the reason above therefor...
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 `no-raw-colors` rule and its compatibility with Tailwind v4's namespaced color theme keys..
How is shadcn-ui/lint's `no-raw-colors` rule and its compatibility with Tailwind v4's namespaced color theme keys. positioned in the market?
What are the foundational technologies related to shadcn-ui/lint's `no-raw-colors` rule and its compatibility with Tailwind v4's namespaced color theme keys.?
What open-source repositories focus on shadcn-ui/lint's `no-raw-colors` rule and its compatibility with Tailwind v4's namespaced color theme keys.?
Engagement Signals
Cross-Market Term Frequency
Quantifies the cross-market adoption of foundational terms like color- and no-raw-colors by tracking occurrence frequency across active SaaS architectures and enterprise developer debates.
SaaS Metrics