Question

v0 'add to codebase' command overwrote my globals.css and now my site colors are gone

Solved · 151 viewsasked by imani_w

Ran the npx shadcn add command that v0 gives you to pull a dashboard block into my existing app. It asked a couple of questions and I pressed enter through them. Now all my custom brand colors are replaced by grey shadcn defaults. My hero section is grey on grey.

What I’ve tried

Undo in VS Code doesn't work because the file was changed on disk by the command. I don't use git yet (I know).

Comment
Do you have the old colors anywhere? Figma, a screenshot, the live site? aiko_n

2 answers

Marked as helpful by the asker
aiko_n

Pressing enter accepted "overwrite". Two ways back:

  1. VS Code keeps local history: right-click globals.css → Open Timeline, pick the version from before the command, restore it.
  2. If that's empty, your old colors are probably still in the built CSS of your last deploy (view source on the live site, search for --primary).

Then merge: keep your :root variables, and only add the new variables the block needs (usually --sidebar-* or --chart-*). Next time answer n on overwrite prompts and merge by hand.

And please git init today. Every command that writes files is one bad enter away from this.

Comment
Timeline had it!! Didn't even know that existed. Also did git init imani_w
Timeline has saved me more than once. Good call. dev_ana
nordic_nick

For next time: commit before every CLI command that generates files. git diff afterwards shows exactly what it touched and git checkout -- app/globals.css undoes it.

Comment