{"record":{"id":"a9e28eec6ad0443e","repo":"shadcn-ui/ui","slug":"token-reason","errorCode":null,"errorMessage":"  - ${token}: ${reason}","messagePattern":"  - \\$\\{token\\}: \\$\\{reason\\}","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/shadcn/src/migrations/migrate-base-color.ts","lineNumber":192,"sourceCode":"  // base color.\n  await updateConfigBaseColor(config, targetBaseColor)\n\n  const skippedTokens = new Map<string, string>()\n  for (const { token, reason } of skipped) {\n    if (!skippedTokens.has(token)) {\n      skippedTokens.set(token, reason)\n    }\n  }\n\n  if (skippedTokens.size > 0) {\n    logger.break()\n    logger.warn(\n      `Skipped ${skippedTokens.size} token${\n        skippedTokens.size === 1 ? \"\" : \"s\"\n      }. These were left untouched:`\n    )\n    for (const [token, reason] of Array.from(skippedTokens)) {\n      logger.warn(`  - ${token}: ${reason}`)\n    }\n  }\n}\n\nexport function getBaseColorMigration(\n  css: string,\n  sourceVars: CssVars,\n  targetVars: CssVars,\n  tailwindVersion: TailwindVersion\n): {\n  cssVars: { light: Record<string, string>; dark: Record<string, string> }\n  skipped: SkippedToken[]\n} {\n  const currentVars = readCssVars(css)\n\n  const light: Record<string, string> = {}\n  const dark: Record<string, string> = {}\n  const skipped: SkippedToken[] = []","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/shadcn-ui/ui/blob/c06da1d0e91e97b607d1359372347528bb35b090/packages/shadcn/src/migrations/migrate-base-color.ts#L174-L210","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","solutions":["For each listed token decide: keep the override, or port it to the target palette value from colors/<to>.json.","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.","For 'not found in your CSS' tokens, add them to :root (and .dark where applicable) if you want them managed by future migrations."],"exampleFix":"/* before — warning output:\n     - --primary: does not match the source base color\n     - --radius: not found in your CSS */\n\n/* after — align tokens so the next run migrates them */\n:root {\n  --primary: 240 5.9% 10%;  /* stock zinc value, so the swap matches */\n  --radius: 0.5rem;         /* added so it is now managed */\n}","handlingStrategy":"validation","validationCode":"import { getBaseColorMigration } from '@/src/migrations/migrate-base-color'\n\n// Preview exactly which tokens will be skipped and why, before running the CLI:\nconst css = await fs.readFile(config.resolvedPaths.tailwindCss, 'utf-8')\nconst { cssVars, skipped } = getBaseColorMigration(css, sourceVars, targetVars, 'v4')\n\nfor (const { token, reason } of skipped) {\n  console.warn(`${token}: ${reason}`) // 'not found in your CSS' | 'does not match the source base color'\n}\nif (skipped.length > 0) {\n  console.info('Fix or accept these tokens before migrating.')\n}","typeGuard":"type SkippedReason = 'not found in your CSS' | 'does not match the source base color'\n\nfunction isSkippableReason(reason: string): reason is SkippedReason {\n  return (\n    reason === 'not found in your CSS' ||\n    reason === 'does not match the source base color'\n  )\n}","tryCatchPattern":null,"preventionTips":["Before migrating, diff your :root/.dark blocks against the stock source palette (colors/<from>.json) to spot customized tokens.","Document intentional overrides in a comment next to the token so reviewers know why it appears in the skipped list.","Add missing palette tokens to :root/.dark if you want future base-color migrations to manage them."],"tags":["shadcn","css","base-color","migration","css-variables"],"backgroundTag":"css-variable-mismatch","analyzedSha":"c06da1d0e91e97b607d1359372347528bb35b090","analyzedAt":"2026-08-21T17:08:35.471Z","contentChangedAt":"2026-08-21T17:08:35.471Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}