-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
WIP: Update tailwind to version 4.0.0 #5990
base: main
Are you sure you want to change the base?
Conversation
@Flo0807 mentioned in the related issue that the plugin works if it is directly exported as function: phoenixframework/tailwind#107 (comment) I verified that it works, but I'm hesitant to rely on this. v4 doesn't really document how plugins should look like so that could change. I think if we wait for tailwindlabs/tailwindcss#15934, we should be good! |
51b9450
to
59e1743
Compare
59e1743
to
9255040
Compare
@variant phx-click-loading ([".phx-click-loading&", ".phx-click-loading &"]); | ||
@variant phx-submit-loading ([".phx-submit-loading&", ".phx-submit-loading &"]); | ||
@variant phx-change-loading ([".phx-change-loading&", ".phx-change-loading &"]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried the variants this way and it was not working, it should be:
@variant phx-click-loading ([".phx-click-loading&", ".phx-click-loading &"]); | |
@variant phx-submit-loading ([".phx-submit-loading&", ".phx-submit-loading &"]); | |
@variant phx-change-loading ([".phx-change-loading&", ".phx-change-loading &"]); | |
@custom-variant phx-click-loading (.phx-click-loading&, .phx-click-loading &); | |
@custom-variant phx-submit-loading (.phx-submit-loading&, .phx-submit-loading &); | |
@custom-variant phx-change-loading (.phx-change-loading&, .phx-change-loading &); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for fixing this! Looking at the updated tailwind docs, we might also want to use @custom-variant
instead of @variant
? https://tailwindcss.com/docs/functions-and-directives#variant-directive
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so. Here's are more details about it:
https://tailwindcss.com/docs/hover-focus-and-other-states#registering-a-custom-variant
This is waiting on the elixir library being updated to support tailwind v4 in phoenixframework/tailwind#103.
Things I'm not sure about:
assets/css/tailwind_heroicons.js
, but I'm not sure about the name and I don't think it belongs inassets/css
. Also, for now, the tailwind standalone cli doesn't bundle the javascript library, so the heroicons plugin fails to load without runningnpm install tailwindcss
or similar. See [v4] Standalone cli doesn't bundle tailwindcss js library tailwindlabs/tailwindcss#15235.