dioxus icon indicating copy to clipboard operation
dioxus copied to clipboard

feat: update examples to tailwind v4

Open danielkov opened this issue 7 months ago • 1 comments

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

  • Updated docs: DioxusLabs/docsite#473

danielkov avatar Apr 01 '25 22:04 danielkov

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? 🙏

danielkov avatar Apr 15 '25 23:04 danielkov

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

jlowry avatar Apr 29 '25 09:04 jlowry

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 (https://github.com/DioxusLabs/dioxus-template/pull/68 and https://github.com/DioxusLabs/docsite/pull/473) both use the npx CLI

ealmloff avatar Apr 30 '25 12:04 ealmloff