← Back to AI Insights
Gemini Executive Synthesis

shadcn-ui/lint's `no-raw-colors` rule and its compatibility with Tailwind v4's namespaced color theme keys.

Technical Positioning
The linter's mandate to enforce semantic color usage and prevent raw color values is compromised by its inability to recognize Tailwind v4's standard namespaced color declarations, rendering the rule ineffective in modern Tailwind projects.
SaaS Insight & Market Implications
The `no-raw-colors` rule fails to recognize Tailwind v4's namespaced color theme keys (`--background-color-*`, `--text-color-*`, `--border-color-*`), incorrectly flagging valid semantic utilities as undeclared. This fundamental parsing error forces developers to either disable the rule or accept misleading suggestions that expose raw primitive colors, undermining the very semantic abstraction Tailwind v4 aims to provide. The issue is compounded by `no-unknown-classes` deferring color class verdicts to `no-raw-colors`, creating a cascading failure. This demonstrates a critical gap in the linter's compatibility with modern Tailwind v4 theme conventions, severely limiting its utility and increasing developer frustration in enforcing design system integrity.
Proprietary Technical Taxonomy
no-raw-colors Tailwind v4 namespaced color theme keys @theme declarations color- applyTokenDeclarations --background-color-* --text-color-* --border-color-*

Raw Developer Origin & Technical Request

Source Icon GitHub Issue Sep 14, 2026
Repo: shadcn-ui/lint
no-raw-colors does not read Tailwind v4 namespaced color theme keys

### 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.

Extracted Positioning
shadcn-ui/lint's `no-raw-colors` rule and its interpretation of custom `--text-*` CSS variables within Tailwind v4 `@theme` blocks.
The linter's objective to enforce design system consistency, particularly regarding color usage, is undermined by its misinterpretation of Tailwind v4's theme structure, where `--text-*` variables define font sizes, not just colors.
Extracted Positioning
shadcn-ui/lint's `parseDeclarations` function, specifically its CSS comment stripping regex and its impact on theme parsing and the `no-arbitrary-values` rule.
The linter's core function of verifying design system rules and preventing arbitrary values is undermined by a regex flaw that incorrectly parses `@source` globs, leading to theme discard and erroneous suggestions.
Extracted Positioning
shadcn-ui/lint's stylesheet resolution for `package.json` `exports` subpath patterns.
The linter's ability to verify design system rules is compromised by its failure to resolve stylesheets from standard package exports, leading to silent degradation and inaccurate reporting.

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?
Based on our AI analysis of the original developer request, its primary technical positioning is: The linter's mandate to enforce semantic color usage and prevent raw color values is compromised by its inability to recognize Tailwind v4's standard namespaced color declarations, rendering the rule ineffective in modern Tailwind projects.
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.?
Our proprietary extraction maps shadcn-ui/lint's `no-raw-colors` rule and its compatibility with Tailwind v4's namespaced color theme keys. to adjacent architectural concepts including no-raw-colors, Tailwind v4 namespaced color theme keys, @theme declarations, color-.
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.?
Yes, open-source adoption is correlated. An active project titled 'shadcn-ui/cn' explores similar frameworks: cn is a new engine for Tailwind class merging and conflict resolution. It replaces tailwind-merge and clsx. Same APIs. Full parity. And it is 30× f...

Engagement Signals

0
Replies
open
Issue Status

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.