Skip to content

CSS warning after running a Vite build #349

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

Closed
gregmsanderson opened this issue Feb 25, 2025 · 1 comment
Closed

CSS warning after running a Vite build #349

gregmsanderson opened this issue Feb 25, 2025 · 1 comment

Comments

@gregmsanderson
Copy link

Describe the bug
When you do a build using Vite (6.1.1) there are CSS warnings. It looks like they are caused by invalid Tailwind v4 in the components:

vite v6.1.1 building for production...
✓ 2437 modules transformed.
rendering chunks (22)...warnings when minifying css:
▲ [WARNING] Unexpected ")" [css-syntax-error]

    <stdin>:2:88700:
      2 │ ...cription\]\:text-center:has(:is()){text-align:center}.has-\[tabl...
        ╵                                    ^


▲ [WARNING] Unexpected ")" [css-syntax-error]

    <stdin>:2:156786:
      2 │ ...ion\=left\]\:cursor-e-resize:is(){cursor:e-resize}.\[data-resiza...
        ╵                                    ^


▲ [WARNING] Unexpected ")" [css-syntax-error]

    <stdin>:2:156861:
      2 │ ...on\=right\]\:cursor-w-resize:is(){cursor:w-resize}:is(.\*\*\:\[k...

The second two warnings appear to be caused by this line in table.tsx which styles the columnResizer :

"&[data-resizable-direction=left]:cursor-e-resize &[data-resizable-direction=right]:cursor-w-resize data-[resizable-direction=both]:cursor-ew-resize",

Removing that single line removes the warnings. I don't think you can use & like that in a className value?

I haven't located what is causing the first warning.

To Reproduce
Steps to reproduce the behavior:

  1. Install the components (I just ran the diff command to fetch the latest ones)
  2. pnpm run build (or equivalent) when using Vite.
  3. The build shows those warnings

Expected behavior
No CSS warnings during a build.

Desktop (please complete the following information):
Mac

@irsyadadl
Copy link
Owner

I’m not experiencing that issue anymore, at least for now. Just make sure your Vite and Tailwind/Vite versions are up to date. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants