shadcn-ui/ui · warning

- ${token}: ${reason}

Error message

  - ${token}: ${reason}

What it means

Not a thrown exception — the per-token detail lines of the skipped-token warning (printed by the same logger.warn loop as the summary line). Each line names one CSS custom property that the base-color migration left untouched and why: 'not found in your CSS' (the token is absent from :root/.dark) or 'does not match the source base color' (its current value was changed from the stock palette, i.e. a customization).

Source

Thrown at packages/shadcn/src/migrations/migrate-base-color.ts:192

  // base color.
  await updateConfigBaseColor(config, targetBaseColor)

  const skippedTokens = new Map<string, string>()
  for (const { token, reason } of skipped) {
    if (!skippedTokens.has(token)) {
      skippedTokens.set(token, reason)
    }
  }

  if (skippedTokens.size > 0) {
    logger.break()
    logger.warn(
      `Skipped ${skippedTokens.size} token${
        skippedTokens.size === 1 ? "" : "s"
      }. These were left untouched:`
    )
    for (const [token, reason] of Array.from(skippedTokens)) {
      logger.warn(`  - ${token}: ${reason}`)
    }
  }
}

export function getBaseColorMigration(
  css: string,
  sourceVars: CssVars,
  targetVars: CssVars,
  tailwindVersion: TailwindVersion
): {
  cssVars: { light: Record<string, string>; dark: Record<string, string> }
  skipped: SkippedToken[]
} {
  const currentVars = readCssVars(css)

  const light: Record<string, string> = {}
  const dark: Record<string, string> = {}
  const skipped: SkippedToken[] = []

View on GitHub (pinned to c06da1d0e9)

Solutions

  1. For each listed token decide: keep the override, or port it to the target palette value from colors/<to>.json.
  2. To have the CLI migrate a listed token next time, set its value back to the source palette's stock value first, then re-run the migration.
  3. For 'not found in your CSS' tokens, add them to :root (and .dark where applicable) if you want them managed by future migrations.

Example fix

/* before — warning output:
     - --primary: does not match the source base color
     - --radius: not found in your CSS */

/* after — align tokens so the next run migrates them */
:root {
  --primary: 240 5.9% 10%;  /* stock zinc value, so the swap matches */
  --radius: 0.5rem;         /* added so it is now managed */
}
Defensive patterns

Strategy: validation

Validate before calling

import { getBaseColorMigration } from '@/src/migrations/migrate-base-color'

// Preview exactly which tokens will be skipped and why, before running the CLI:
const css = await fs.readFile(config.resolvedPaths.tailwindCss, 'utf-8')
const { cssVars, skipped } = getBaseColorMigration(css, sourceVars, targetVars, 'v4')

for (const { token, reason } of skipped) {
  console.warn(`${token}: ${reason}`) // 'not found in your CSS' | 'does not match the source base color'
}
if (skipped.length > 0) {
  console.info('Fix or accept these tokens before migrating.')
}

Type guard

type SkippedReason = 'not found in your CSS' | 'does not match the source base color'

function isSkippableReason(reason: string): reason is SkippedReason {
  return (
    reason === 'not found in your CSS' ||
    reason === 'does not match the source base color'
  )
}

Prevention

When it happens

Trigger: Same conditions as the skipped-token summary: running `shadcn migrate base-color` when individual tokens like --primary or --radius are missing from the stylesheet or diverge from the source palette's stock values; one line is printed per unique skipped token, deduplicated via the skippedTokens map.

Common situations: Themes with brand overrides on individual variables; stylesheets that only define a subset of the palette; leftover manual edits from earlier migrations or AI-generated CSS.

Related errors


AI-assisted analysis of shadcn-ui/ui@c06da1d0e9 (2026-08-21). Data as JSON: /api/errors/a9e28eec6ad0443e. Report an issue: GitHub.