Skip to content

feat: update examples to tailwind v4 #3943

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

danielkov
Copy link

Context

What changed?

  • Updated examples/tailwind to use V4 Tailwind CSS CLI
    • Removed tailwind.config.js as it is unnecessary for V4 with a minimal setup
    • Updated outdated utility classes
  • Updated example-projects/ecommerce-site to use V4 Tailwind CSS CLI

See also

Copy link
Member

@jkelleyrtp jkelleyrtp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

I see several package.json and package-lock.json files being generated....

I believe we don't need those - the tailwind CLI should be able to work without it.

Do you mind removing those and/or updating any docs to match?

@danielkov
Copy link
Author

Hi @jkelleyrtp 👋

Thank you for the review!

the tailwind CLI should be able to work without it

That has not been my experience. I had to run npm install with at minimum this package.json file present, before running npx @tailwindcss/cli -i ./input.css -o ./assets/tailwind.css, otherwise I got something along the lines of:

module "tailwindcss" not found

Do you mind sharing your setup / steps, just so I can confirm and update accordingly? 🙏

@jlowry
Copy link

jlowry commented Apr 29, 2025

Do you mind sharing your setup / steps, just so I can confirm and update accordingly? 🙏

I've tested it and can confirm the The Tailwind CSS Standalone CLI does not need a package.json. See https://tailwindcss.com/blog/standalone-cli

@ealmloff
Copy link
Member

It depends how you install the tailwind CLI. If you run the CLI via npx which is the default in the tailwind docs then the new version does get installed in your node modules. If you use the standalone CLI, it does not.

The other two PRs that update tailwind (DioxusLabs/dioxus-template#68 and DioxusLabs/docsite#473) both use the npx CLI

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

Successfully merging this pull request may close these issues.

4 participants