{"record":{"id":"d05c95345a3becff","repo":"shadcn-ui/ui","slug":"skipped-skippedtokens-size-token-skippedtokens","errorCode":null,"errorMessage":"Skipped ${skippedTokens.size} token${skippedTokens.size === 1 ? \"\" : \"s\"}. These were left untouched:","messagePattern":"Skipped (.+?) token(.+?)\\. These were left untouched:","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/shadcn/src/migrations/migrate-base-color.ts","lineNumber":186,"sourceCode":"    })\n  }\n\n  migrationSpinner.succeed(\"Migration complete.\")\n\n  // Keep components.json in sync so future `shadcn add` installs use the new\n  // 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[]","sourceCodeStart":168,"sourceCodeEnd":204,"githubUrl":"https://github.com/shadcn-ui/ui/blob/c06da1d0e91e97b607d1359372347528bb35b090/packages/shadcn/src/migrations/migrate-base-color.ts#L168-L204","documentation":"Not a thrown exception — a logger.warn emitted after the base-color migration finishes. getBaseColorMigration only rewrites tokens that currently still hold the source palette's stock value; tokens missing from your CSS ('not found in your CSS') or manually customized ('does not match the source base color') are collected and reported here, left untouched on purpose so your overrides survive.","triggerScenarios":"Running `shadcn migrate base-color` on a stylesheet where some source-palette tokens are absent (partial :root/.dark blocks) or hold hand-edited values — e.g. you tweaked --primary or --radius yourself — plus tokens identical in both palettes are silently skipped without being listed.","commonSituations":"Hand-tuned themes; Tailwind v3 to v4 transitions where values are written differently (hsl() wrapping); partially adopted variable sets; brand color overrides that developers actually want preserved.","solutions":["Treat the warning as a review list: open your CSS and update each listed token to the target palette's value (or confirm you want to keep the override).","If a listed token should have migrated, reset it to the source palette's stock value in your CSS and re-run `shadcn migrate base-color` — it will then match and be replaced.","Fetch the target palette values from the registry (colors/<to>.json) to copy exact values for manual updates."],"exampleFix":"/* before — hand-tuned token blocked the swap; migration warned:\n   Skipped 1 token. These were left untouched:\n     - --primary: does not match the source base color */\n:root { --primary: 142 76% 36%; }\n\n/* after — manually port the token to the target palette (neutral) */\n:root { --primary: 0 0% 9%; }","handlingStrategy":"validation","validationCode":"import { readFileSync } from 'fs'\nimport postcss from 'postcss'\n\n// Dry-run the migration's own matcher before writing anything:\n// tokens absent from :root/.dark or diverging from the stock source values will be skipped.\nfunction findAtRiskTokens(cssPath: string, stockSourceVars: Record<string, string>): string[] {\n  const current: Record<string, string> = {}\n  postcss.parse(readFileSync(cssPath, 'utf-8')).walkRules((rule) => {\n    if (rule.selector !== ':root' && rule.selector !== '.dark') return\n    rule.walkDecls((d) => { if (d.prop.startsWith('--')) current[d.prop] = d.value.trim().replace(/\\s+/g, ' ') })\n  })\n  return Object.entries(stockSourceVars)\n    .filter(([name, value]) => current[`--${name}`] !== value.trim().replace(/\\s+/g, ' '))\n    .map(([name]) => `--${name}`)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep theme tokens at stock palette values in source control; apply brand overrides after (or in separate tokens) so migrations can match them.","Run `getBaseColorMigration(css, sourceVars, targetVars, tailwindVersion)` as a dry-run (it is exported) and review the returned `skipped` list before letting the CLI write.","Expect the warning on customized themes — it protects your overrides rather than indicating failure."],"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"}