shadcn-vue icon indicating copy to clipboard operation
shadcn-vue copied to clipboard

[Bug]: Installation overrode my custom tailwind theme colors

Open demiro opened this issue 2 years ago • 4 comments
trafficstars

Environment

Developement/Production OS: Windows 10 19043.1110
Node version: 16.0.0
Package manager: [email protected]
Radix Vue version: 1.0.0
Shadcn Vue version: 1.0.0
Vue version: 3.0.0
Nuxt version: 3.0.0
Nuxt mode: universal
Nuxt target: server
CSS framework: [email protected]
Client OS: Windows 10 19043.1110
Browser: Chrome 90.0.4430.212

Link to minimal reproduction

/

Steps to reproduce

  • have custom theme colors like 'primary' in your tailwind.config.js before installing
  • install (I used pnpm like pnpm dlx shadcn-vue@latest init and answered these questions

√ Would you like to use TypeScript (recommended)? ... no / yes √ Which framework are you using? » Vite √ Which style would you like to use? » Default √ Which color would you like to use as base color? » Slate √ Where is your Tailwind CSS file? ... src/assets/main.scss √ Would you like to use CSS variables for colors? ... no / yes √ Where is your tailwind.config located? ... tailwind.config.js √ Configure the import alias for components: ... @/components √ Configure the import alias for utils: ... @/lib/utils √ Write configuration to components.json. Proceed? ... yes

  • after rerunning my pnpm run dev I am getting while loads of errors like

'The bg-primary-100/80 class does not exist. If bg-primary-100/80 is a custom class, make sure it is defined within a @layer directive.'

and after inspecting my tailwind.config.js, my custom theme colors were not there

Describe the bug

installation overrides the tailwind.config.js instead of add / merge

Expected behavior

my previous settings to still be there

Conext & Screenshots (if applicable)

No response

demiro avatar Oct 21 '23 07:10 demiro

Not only colors, BUT pretty much EVERYTHING.... including my main.scss (main tailwnd's css) ...instead of ADDING / MERGING

demiro avatar Oct 21 '23 07:10 demiro

Unfortunately yes it overrides (same for others shadcn CLIs) instead of modifying the current configs, shadcn-vue CLI is good for when starting a project from scratch

Maybe we could rewrite the CLI and use Magicast or MagicString for modify/merging configs

sadeghbarati avatar Oct 21 '23 07:10 sadeghbarati

I believe there's something from unjs could help us here. Not sure 🙈

zernonia avatar Nov 10 '23 10:11 zernonia

For the time being, we could modify the cli to check if repo git is in clean status (all changes have been commited) and if not, exit with a warning.

Saeid-Za avatar Mar 03 '24 16:03 Saeid-Za