Skip to content

Introduce proper v4 support for new apps #464

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

Merged
merged 4 commits into from
Jan 23, 2025

Conversation

flavorjones
Copy link
Member

@flavorjones flavorjones commented Jan 23, 2025

Main changes to the installer:

  • bump the dep on tailwindcss-ruby to ~> 4.0
  • drop the config.tailwind.js file, and the -c option from the tailwindcss command
  • add import "tailwindcss"; to application.tailwind.css
  • update class names in the templates
  • remove the Inter font (see below)

Note that this PR also removes the Inter font, which may leave an orphaned stylesheet reference in existing apps that upgrade:

# previously installed into layouts/application.html.erb
<%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %>

This will need to be replaced/fixed by an upgrade generator/task, but I don't think it needs to be part of this PR right now.

cc @EricGusmao for feedback

Closes #463

@flavorjones flavorjones force-pushed the flavorjones-proper-v4-support branch from e614cdf to 6c33f3d Compare January 23, 2025 15:37
@EricGusmao
Copy link
Contributor

@flavorjones wow, so fast! There is still something missing though, renaming the generator class names to suport the newer ones that were renamed, as my commit fd342bc

for reference: https://tailwindcss.com/docs/upgrade-guide#renamed-utilities

Note: we will need to smooth this out in an upgrade step.
@flavorjones flavorjones force-pushed the flavorjones-proper-v4-support branch from 6c33f3d to 144eaa7 Compare January 23, 2025 16:20
@flavorjones
Copy link
Member Author

Edited this PR to remove the injected compatibility styles. I'll make that part of the upgrade generator in a separate PR.

@flavorjones
Copy link
Member Author

@EricGusmao Thanks for the commit updating class names, I've cherry-picked that into this PR.

@EricGusmao
Copy link
Contributor

Edited this PR to remove the injected compatibility styles. I'll make that part of the upgrade generator in a separate PR.

so the idea is to create a upgrade generator to patch current installations?

@flavorjones
Copy link
Member Author

so the idea is to create a upgrade generator to patch current installations

Yes, I've got one ready to create a PR with that's pretty simple -- does minimal patching and then runs the upstream upgrader.

@EricGusmao Do you agree this PR is OK to merge? Can you think of anything missing for the "tailwindcss:install" use case in a new app?

@flavorjones flavorjones changed the title Introduce proper v4 support Introduce proper v4 support for new apps Jan 23, 2025
@flavorjones
Copy link
Member Author

I think this is a good improvement, so I'm going to merge it. We can continue to fix things as we find them.

@flavorjones flavorjones merged commit 629da53 into main Jan 23, 2025
12 checks passed
@EricGusmao
Copy link
Contributor

EricGusmao commented Jan 23, 2025

@EricGusmao Do you agree this PR is OK to merge? Can you think of anything missing for the "tailwindcss:install" use case in a new app?

Yes, lgtm

@flavorjones flavorjones deleted the flavorjones-proper-v4-support branch January 23, 2025 18:18
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.

Installation should assume Tailwind CSS v4
2 participants