Skip to content
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

Styles from Copilotkit Overriding MUI and Shadcn Styles #366

Open
dewanshDT opened this issue May 28, 2024 · 5 comments
Open

Styles from Copilotkit Overriding MUI and Shadcn Styles #366

dewanshDT opened this issue May 28, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@dewanshDT
Copy link

dewanshDT commented May 28, 2024

Issue: Styles from Copilotkit Overriding MUI and Shadcn Styles

Describe the bug
I'm experiencing an issue where the styles from Copilotkit are overriding the styles of other libraries, specifically MUI and Shadcn. This problem arises because Copilotkit exports all the base classes in its styles.css file, which needs to be imported while working with Copilotkit:

import "@copilotkit/react-ui/styles.css";

These styles from styles.css are conflicting with the styles of MUI and Shadcn components. For example, in the attached code sandbox demonstration, the styles of the Shadcn Alert Dialog component, specifically the confirm button's styles, are being overridden by Copilotkit's styles.

To Reproduce
Steps to reproduce the behavior (the easier it is to replicate, the sooner it will get fixed):

  1. Create a next js project with tailwind
  2. Import Copilotkit styles: import "@copilotkit/react-ui/styles.css";
  3. Use MUI and Shadcn components in the project.
  4. Observe that the styles of MUI and Shadcn components' styles are overridden by Copilotkit styles.

You can see the working demonstration of the issue in the following CodeSandbox link:
CodeSandbox Demo

Expected behavior
The styles from Copilotkit should not override the styles of MUI and Shadcn components.

Screenshots
expected
image
current
image

Environment:

  • OS/Browser: Windows 11, Chrome
  • Runtime: self-hosted
  • Frontend Framework: Next

CopilotKit Packages

import "@copilotkit/react-ui"
@dewanshDT dewanshDT added the bug Something isn't working label May 28, 2024
@datanfsun
Copy link

12

@datanfsun
Copy link

12

11

@mubinansari
Copy link

The same issue also happens with @copilotkit/react-textarea

A possible solution I see is that copilotkit prefixes it's tailwind classnames to avoid conflicts. (it's commented out currently)

@ataibarkai
Copy link
Collaborator

thanks for the suggestion @mubinansari

@mme
Copy link
Collaborator

mme commented Jun 5, 2024

@dewanshDT @mubinansari this issue should be fixed with the latest release, also for @copilotkit/react-textarea

thx again for the prefixing suggestion, we made it work this way.

Could you check if the issue is gone on your end?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants