Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Data grid style conflict with tailwindbase #3668

Closed
robert-luoqing opened this issue Dec 16, 2024 · 5 comments
Closed

Data grid style conflict with tailwindbase #3668

robert-luoqing opened this issue Dec 16, 2024 · 5 comments
Labels

Comments

@robert-luoqing
Copy link

Describe the bug

When I import Tailwind's style components into index.css, the grid's style changes unexpectedly and no longer appears as the default or preferred design. However, when I comment out @tailwind base;, the style reverts to normal.

Here is the code I'm using:

@tailwind base;
@tailwind components;
@tailwind utilities;

Issue Screenshots
Unexpected style (with @tailwind base;)
image
Normal style (without @tailwind base;)
image

Request for Help
How can I resolve this issue? I want to include @tailwind base; in my project but still maintain the normal style.

To Reproduce

Link to code example:

Expected behavior

Environment

  • "react-data-grid": "^7.0.0-beta.47",
  • react/react-dom: "^18.3.1",

Additional context

@amanmahajan7
Copy link
Contributor

Can you create a reproducible example?

@robert-luoqing
Copy link
Author

Here is sample.
The reproduction step is as follows:

  1. npx create-react-app data-grid-test
  2. npm install react-data-grid
  3. Follow https://tailwindcss.com/docs/guides/create-react-app to add tailwind to the project
  4. Put data-grid to App.js which is included in the zip file
  5. The difference style if you comment out the "@tailwind base;" in index.css.

data-grid-test.zip

@amanmahajan7
Copy link
Contributor

Can you create a codesandbox/stackblitz example?

@robert-luoqing
Copy link
Author

@amanmahajan7
Copy link
Contributor

RDG uses css layers and it seems like tailwind styles are unlayed in the above example and the following block overrides RDG styles

*, ::before, ::after {
    box-sizing: border-box;
    border-width: 0;
    border-style: solid;
    border-color: #e5e7eb;

Is this a setup issue as it looks like tailwind does have layers . I am changing this issue to a discussion as it is not a bug in RDG

@adazzle adazzle locked and limited conversation to collaborators Dec 18, 2024
@amanmahajan7 amanmahajan7 converted this issue into discussion #3674 Dec 18, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

2 participants