Skip to content

Data grid style conflict with tailwindbase #3668

Description

@robert-luoqing

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

Activity

  1. amanmahajan7 commented on Dec 16, 2024

    @amanmahajan7
    Collaborator

    Can you create a reproducible example?

  2. robert-luoqing commented on Dec 17, 2024

    @robert-luoqing
    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

  3. amanmahajan7 commented on Dec 17, 2024

    @amanmahajan7
    Collaborator

    Can you create a codesandbox/stackblitz example?

  4. amanmahajan7 commented on Dec 18, 2024

    @amanmahajan7
    Collaborator

    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

  5. locked and limited conversation to collaborators on Dec 18, 2024
  6. converted this issue into a discussion #3674 on Dec 18, 2024
  7. added theissue type on Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions