Feature: Tailwind 4 compatibility #8621
Replies: 14 comments 11 replies
-
Hello, this is a feature request to migrate to Tailwind 4 |
Beta Was this translation helpful? Give feedback.
-
@import "tailwindcss" source(none);
@plugin "@activeadmin/activeadmin/plugin";
@source "/bundle/ruby/3.4.0/gems/activeadmin-4.0.0.beta15/app/views/**/*.{arb,erb,html,rb}";
@source "/bundle/ruby/3.4.0/gems/activeadmin-4.0.0.beta15/plugin.js";
@source "/app/node_modules/flowbite/plugin.js";
@source "../../admin/**/*.rb";
@source "../../views/active_admin/**/*.{arb,erb,html,rb}";
@source "../../views/admin/**/*.{arb,erb,html,rb}";
@custom-variant dark (&:where(.dark, .dark *));
@utility ring-opacity-5 {
--tw-ring-opacity: 0.05;
}
@layer base {
*,
::after,
::before,
::backdrop,
::file-selector-button {
border-color: var(--color-gray-200, currentColor);
}
} This works for Tailwind 4 |
Beta Was this translation helpful? Give feedback.
-
@tagliala there is no mention of the Tailwind version supported for the v4 branches of ActiveAdmin. So I would assume that the latest major version would be supported. So I consider this a bug, and if it is by design then the bug is that the documentation does not mention this. |
Beta Was this translation helpful? Give feedback.
-
Tailwind 4 has just been released, and ActiveAdmin is still in beta. When this was written, Tailwind 4 was not available, so the documentation reflected the latest version at that time |
Beta Was this translation helpful? Give feedback.
-
Blocked upstream by: rails/cssbundling-rails#164 |
Beta Was this translation helpful? Give feedback.
-
ActiveAdmin is using cssbundling instead of |
Beta Was this translation helpful? Give feedback.
-
Yes, it is used in the CI for integration specs and it is not mandatory but it is the suggested approach AFAIK It is not mentioned in the documentation, but here it is a PR here: https://github.com/activeadmin/activeadmin/pull/8545/files |
Beta Was this translation helpful? Give feedback.
-
@tagliala suggested by whom? Rails or the ActiveAdmin team? |
Beta Was this translation helpful? Give feedback.
-
ActiveAdmin, but it is not an official and documented suggestion. If you take a look at the CI, it is how integrations test are set up: #8545 is still a draft. If it is going to be approved, than it would be an official suggestion However, ideally that should not be mandatory. ActiveAdmin 4 could also work without Node, see #8223 |
Beta Was this translation helpful? Give feedback.
-
I currently have ActiveAdmin It would be great if ActiveAdmin supported Tailwind CSS v4 in a way that works seamlessly with Happy to test or contribute if needed, as I’m certainly looking forward to upgrading to Tailwind CSS v4! |
Beta Was this translation helpful? Give feedback.
-
The plugin needs to use Then the vendored Then you can just install Guessing you have the rake tasks etc. that is already based on my comment in the discussion about running ActiveAdmin without node. |
Beta Was this translation helpful? Give feedback.
-
@henrikbjorn thanks for your detailed answer, but doesn't this Those sources lines would also most likely not work without dynamic path logic (maybe with a
Which rake tasks are you referring to? I'm just using the default |
Beta Was this translation helpful? Give feedback.
-
Ref: #8623 |
Beta Was this translation helpful? Give feedback.
-
Got to rewrite ActiveAdmin tailwindcss plugin completely to have full compatibility with tailwindcss v4: https://gist.github.com/amkisko/af1b2f7dc4f0f941437ea16400277864 -- seems to work, might be that some styles are missing or broken. But this seems to be what should be done to current codebase. Since tailwindcss v4 is backward compatible with v3, we can still use javascript config for dynamic paths. 🎉 |
Beta Was this translation helpful? Give feedback.
-
Pre-requirements:
Expected behavior
Tailwind 4 goes a long way of having BC with earlier versions. But the
plugin.js
is using some invalid utility types and there for isn't compatible with it.Actual behavior
Should work with Tailwind 4 through the
@plugin
directlive or their js config bc layerHow to reproduce
Install ActiveAdmin and use Tailwind 4
Beta Was this translation helpful? Give feedback.
All reactions