shadcn-vue
shadcn-vue copied to clipboard
[Bug]: Installation overrode my custom tailwind theme colors
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 initand 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 devI 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
Not only colors, BUT pretty much EVERYTHING.... including my main.scss (main tailwnd's css) ...instead of ADDING / MERGING
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
I believe there's something from unjs could help us here. Not sure 🙈
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.