-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[admin] Provide a pre-built CSS file and a script to customize TW for local modifications #5554
Conversation
542a111
to
e1b4edf
Compare
@elia nice, can you tell a bit about why we are doing this change? Also curious about how this works with other extensions that might have tailwind classes in their admin-related templates. |
The main reason is to allow for straightforward experience installing the admin, for extensions there are a few options, we expect in most cases that extensions will be able to reuse existing components. In case the extension will really need to provide additional components it will require just an updated list of content paths on the tailwind configuration. There's also an experimental JIT mode that is used for the CDN version of TW that wouldn't require compilation at all, but that's a sort of extreme solution, although it would be completely no-build. |
This configuration is a vanilla TW build removing the need for temporary files and ERB tags. Also relegates the dependency on tailwindcss-rails only to the development of the gem itself. By relying on a known target path for the build it will be easy to setup a local TW build that will override that path in the host Rails application, leaving the implementors free to go with whatever JS/CSS builder they want.
e1b4edf
to
3e977fb
Compare
Just to be sure to understand how this works, what if I change a tailwind class in a template and commit to the repo without rebuilding the admin? Would that change the tailwind pre-built file on the next person pulling the repo and starting the server? |
@kennyadsl I had the same concern 💯, so the pre-built script is not tracked in the solidus repo, but is built just before creating the |
We're not writing application code in which it's ok to assume that all tasks should load the environment first.
3e977fb
to
7dc3b14
Compare
Summary
With this PR the new admin will work out of the box without the need for running TW in the host app in order to generate the first instance of the application CSS code.
Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed: