Skip to content

Update code generated with use tailwind from the CLI #15223

@dei8bit

Description

@dei8bit

Describe the problem

Currently When you start a sveltekit project from the CLI and check the option to add tailwind...

| [+] tailwindcss (css framework - https://tailwindcss.com)

  • it installs "tailwindcss": "^3.4.17"
  • generate a postcss.config.js file
  • generate a tailwind.config.js file
  • puts unnecessary imports in the app.css file

Tailwind 4 version is available, works and does not require post CSS

what needs to be changed is not much but would be better.

Describe the proposed solution

In order to update the current setup up to the new setup:

  • upgade ↑ tailwindcss 3.4.17 → 4.0.3
  • add @tailwindcss/vite -d
  • remove postcss.config.js file.
  • remove tailwind.config.ts file.
  • import tailwindcss from '@tailwindcss/vite' ; in vite.config.ts
  • add tailwindcss() in plugins ; in vite.config.ts
  • update de app.css file:
- @import 'tailwindcss/base';
-@import 'tailwindcss/components';
-@import 'tailwindcss/utilities'
+@import "tailwindcss";

that's all :)

Importance

would make my life easier

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions