-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug]: Installing Sidebar component overwrites and causes breaking changes in tailwind.config.js #5814
Comments
may be, It would be nice if the shadcn config is written in a file as a preset and then that is imported in tailwind. one can easily extend the preset and override if required and original content can be left as so when installing new components user configuration won't be overridden. |
Yes @opswiz. When I installed the Sidebar for the first time and my whole webpages UI looked horrible, I thought it didn't install properly and had to discard all changes made during the installation and try again. It was after the 3rd trial I noticed the Felt frustrated to see that all was in my I fixed it by copying the I also noticed some configs I made as numbers like {
0: 0
} is changed to: {
"0": "0"
} I just wonder why it's changing them to strings. |
UP! Some classes stopped working in tailwind |
@guiguicdd can you give a better description of the problem you're facing? |
@onyedikachi23 I created an test for it. Just by adding the sidebar and configuring in nextjs 15 and react 18 like this: <SidebarProvider>
<AppSidebar />
<main>
<SidebarTrigger />
{children}
</main>
</SidebarProvider> export default function Home() {
return (
<div className="h-screen w-full bg-blue-950">
<div className="w-96 h-96 bg-red-600 float-end"></div>
<div className="w-96 h-10 bg-black"></div>
</div>
);
} It will remove de blue bg, div size and the alingment. It doesn't event show in the devtools |
Can't see where you added the |
Describe the bug
I wanted to try out the new Sidebar component. So, I ran:
But during when
npm
is installing it, it updates thetailwind.config.js
. However, most of configs I defined myself were retained, but the customtheme.extend.spacing
has it's properties and values removed.Below is the before and after of the
tailwind.config.js
between installing the Sidebar component:Before installing:
After installing (I haven't touched anything):
Affected component/components
Sidebar
How to reproduce
tailwind.config.js
and note the configs.npx shadcn@latest add sidebar
and you'd noticedtailwind.config.js
has changed.themes.extend.spacing
.Codesandbox/StackBlitz link
The above covers all these.
Logs
System Info
Before submitting
The text was updated successfully, but these errors were encountered: