radix-vue / shadcn-vue

Vue port of shadcn-ui
https://www.shadcn-vue.com/
MIT License
4.21k stars 244 forks source link

[Bug]: Installation overrode my custom tailwind theme colors #127

Open demiro opened 10 months ago

demiro commented 10 months ago

Environment

Developement/Production OS: Windows 10 19043.1110
Node version: 16.0.0
Package manager: pnpm@8.6.0
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: tailwindcss@3.3.3
Client OS: Windows 10 19043.1110
Browser: Chrome 90.0.4430.212

Link to minimal reproduction

/

Steps to reproduce

√ 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

'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 commented 10 months ago

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

sadeghbarati commented 10 months ago

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

zernonia commented 10 months ago

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

Saeid-Za commented 6 months ago

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.