skeleton: Problem with TailwindCSS v4 migration

Current Behavior

Error:

[plugin:@tailwindcss/vite:generate:serve] Cannot use `@variant` with unknown variant: md

D:/projects/node/ninja/node_modules/@skeletonlabs/skeleton/dist/index.css

Error: Cannot use `@variant` with unknown variant: md
    at Jt (file:///D:/projects/node/ninja/node_modules/tailwindcss/dist/lib.mjs:22:523)
    at async Lr (file:///D:/projects/node/ninja/node_modules/tailwindcss/dist/lib.mjs:22:977)
    at async No (file:///D:/projects/node/ninja/node_modules/tailwindcss/dist/lib.mjs:22:1545)
    at async st (file:///D:/projects/node/ninja/node_modules/@tailwindcss/node/dist/index.mjs:10:3322)
    at async C.generate (file:///D:/projects/node/ninja/node_modules/@tailwindcss/vite/dist/index.mjs:1:3932)
    at async TransformPluginContext.transform (file:///D:/projects/node/ninja/node_modules/@tailwindcss/vite/dist/index.mjs:1:1959)
    at async EnvironmentPluginContainer.transform (file:///D:/projects/node/ninja/node_modules/vite/dist/node/chunks/dep-glQox-ep.js:47636:18)
    at async loadAndTransform (file:///D:/projects/node/ninja/node_modules/vite/dist/node/chunks/dep-glQox-ep.js:41320:27)
    at async fetchModule (file:///D:/projects/node/ninja/node_modules/vite/dist/node/chunks/dep-glQox-ep.js:52065:16)
    at async handleInvoke (file:///D:/projects/node/ninja/node_modules/vite/dist/node/chunks/dep-glQox-ep.js:44494:22

In my opinion it the problem is node_modules/@skeletonlabs/skeleton/dist/index.css.

Before:

@variant md {
  /* your styles here */
}

After:

@screen md {
  /* your styles here */
}

Expected Behavior

No response

Steps To Reproduce

  1. Migrate project. Docs
  2. Use npx @skeletonlabs/skeleton-cli migrate skeleton-3
  3. Then run npm run dev

Link to Reproduction / Stackblitz

No response

Environment Information

System: OS: Windows 11 10.0.26100 CPU: (16) x64 12th Gen Intel® Core™ i5-12500H Memory: 2.35 GB / 15.71 GB Binaries: Node: 22.13.0 - C:\Program Files\nodejs\node.exe npm: 10.9.2 - C:\Program Files\nodejs\npm.CMD bun: 1.2.2 - ~.bun\bin\bun.exe Browsers: Edge: Chromium (131.0.2903.146) npmPackages: @skeletonlabs/skeleton: ^3.0.0 => 3.0.0 @skeletonlabs/skeleton-svelte: ^1.0.0 => 1.0.0

More Information

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (9 by maintainers)

Most upvoted comments

@t1ltxz-gxd I agree, we can likely improve the doc guidance to inform folks of the orphaned components in the templates. That it’s their responsibility to clean these up. Unfortunately that’s out of scope for the CLI itself to handle.

https://www.skeleton.dev/docs/get-started/migrate-from-v2#automated-migration

Likewise I’ll chat with @Hugos68 to see if we can collect and log the files that imports are removed. That might be a nice thing to output at the end to give people a checklist to work through.

That’s good, now if you do our migration again it should do a proper migration. Sorry for the trouble, a bug slipped past us during the release.