← Back to AI Insights
Gemini Executive Synthesis

shadcn-ui/lint's `no-raw-colors` rule and its interpretation of custom `--text-*` CSS variables within Tailwind v4 `@theme` blocks.

Technical Positioning
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.
SaaS Insight & Market Implications
The `no-raw-colors` rule incorrectly flags custom `--text-*` font size variables as undeclared theme colors, generating false positives. This misinterpretation stems from the linter's failure to differentiate between font size and color declarations within Tailwind v4's `@theme` structure. The rule's reliance on `cn`'s `defaultConfig()` rather than the project's actual theme configuration highlights a critical disconnect. This bug forces developers to either disable a valuable linting rule or contend with erroneous reports, directly impacting developer experience and trust in the linter's intelligence. It indicates a lack of robust parsing for evolving Tailwind theme conventions, hindering its effectiveness in modern design systems.
Proprietary Technical Taxonomy
no-raw-colors custom --text-* font sizes undeclared theme colors Tailwind v4 theme @theme inline font-size utilities class group cn's defaultConfig()

Raw Developer Origin & Technical Request

Source Icon GitHub Issue Sep 14, 2026
Repo: shadcn-ui/lint
bug: `no-raw-colors` reports custom `--text-*` font sizes as undeclared theme colors

The following report is AI-generated, let me know if you need more details!

## Summary

When a Tailwind v4 theme defines a custom font-size scale with `--text-*`
variables, `no-raw-colors` reports those `text-` classes as undeclared
theme colors. Tailwind reads them as font sizes, but the linter reads them as
text colors.

## Reproduction

`src/index.css` (the `tailwind.css` entry in `components.json`):

```css
@import "tailwindcss";

@theme inline {
--color-foreground: var(--foreground);
}

@theme {
--text-heading: 1.875rem;
--text-heading--line-height: 0.9;
--text-body: 0.875rem;
--text-body--line-height: 1.4;
}
```

`src/page.tsx`:

```tsx
export function Page() {
return (

Title
Body

)
}
```

`eslint.config.js`:

```js
rules: {
"shadcn/no-raw-colors": "error",
}
```

## Expected

No reports. Tailwind generates `text-heading` and `text-body` as font-size
utilities from `--text-heading` and `--text-body`.

## Actual

```text
"text-heading" is not a declared theme color. Use one of: foreground (+…). To add a color, declare --color- in src/index.css first
"text-body" is not a declared theme color. Use one of: foreground (+…). To add a color, declare --color- in src/index.css first
```

## Cause

The class group comes from `cn`'s `defaultConfig()`, not from the theme. That
config only knows Tailwind's built-in font sizes (`text-xs` to `tex...

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 `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 `no-raw-colors` rule and its compatibility with Tailwind v4's namespaced color theme keys.
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.
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 interpretation of custom `--text-*` CSS variables within Tailwind v4 `@theme` blocks..

What problem does shadcn-ui/lint's `no-raw-colors` rule and its interpretation of custom `--text-*` CSS variables within Tailwind v4 `@theme` blocks. solve?
Based on our AI analysis of the original developer request, its primary technical positioning is: 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.
Are engineers actively discussing shadcn-ui/lint's `no-raw-colors` rule and its interpretation of custom `--text-*` CSS variables within Tailwind v4 `@theme` blocks.?
Yes, we have tracked 1 direct responses and active debates regarding this specific topic originating from GitHub Issue.
What architecture is tied to shadcn-ui/lint's `no-raw-colors` rule and its interpretation of custom `--text-*` CSS variables within Tailwind v4 `@theme` blocks.?
Our proprietary extraction maps shadcn-ui/lint's `no-raw-colors` rule and its interpretation of custom `--text-*` CSS variables within Tailwind v4 `@theme` blocks. to adjacent architectural concepts including no-raw-colors, custom --text-* font sizes, undeclared theme colors, Tailwind v4 theme.

Engagement Signals

1
Replies
open
Issue Status

Cross-Market Term Frequency

Quantifies the cross-market adoption of foundational terms like no-raw-colors and @theme inline by tracking occurrence frequency across active SaaS architectures and enterprise developer debates.