Serve engine CSS via tailwindcss-rails engine support - #88
Conversation
Replace the copy-based CSS install with tailwindcss-rails' Rails engine support: the engine's stylesheet is now imported straight from the gem, so it stays in sync with the installed version instead of being copied into the host app at install time. - Move app/assets/tailwind/layered/ui/styles.css to the convention path app/assets/tailwind/layered_ui/engine.css (engine_name is layered_ui) - Remove CopyAssetsGenerator; ImportCssGenerator now injects @import "../builds/tailwind/layered_ui"; - Switch the engine layout to stylesheet_link_tag "tailwind" so propshaft's :app glob no longer emits a stray link to the generated intermediate file - Update README, gemspec post-install message, SKILL.md, AGENTS.md, dummy install docs, and CHANGELOG (flagging the breaking install-flow change) Compiled output is byte-identical to the previous build; fonts and masked SVG icons resolve unchanged. All tests pass.
ReviewSwitches the engine's CSS delivery from a copied file ( generated into the host app) to tailwindcss-rails' engine support, so the engine CSS is compiled directly from the gem on each build. The install generator, layout link tag, documentation, and tests are all updated consistently. IssuesNo issues found. A few things checked:
Verdict✅ Ship - Clean, well-scoped change with thorough documentation and consistent test updates. |
The engine layout now links the compiled build via stylesheet_link_tag "tailwind", which propshaft requires to exist - unlike the previous :app glob that silently tolerated a missing build. On a clean checkout (e.g. CI) there is no app/assets/builds/tailwind.css, so the integration tests raised "asset 'tailwind.css' was not found in the load path". Make the test task depend on app:tailwindcss:build so the CSS (and the engine entry point under builds/tailwind/) is compiled first.
ReviewMigrates engine CSS delivery from copying assets into the host app to using tailwindcss-rails' engine support, so the engine stylesheet stays in sync with the installed gem version automatically. Also removes the now-redundant No issues found - the implementation is clean. Notes (not blocking):
Verdict✅ Ship - clean, well-tested migration with clear breaking-change documentation. |
|
This PR replaces the copy-based CSS install with tailwindcss-rails' engine support, moving the engine stylesheet from No issues found. The migration guide in CHANGELOG is clear, the Rakefile task addition is correctly motivated, tests are updated throughout, and the SKILL.md/AGENTS.md/README updates are consistent with the implementation change. ✅ Ship |
Replace the copy-based CSS install with tailwindcss-rails' Rails engine support: the engine's stylesheet is now imported straight from the gem, so it stays in sync with the installed version instead of being copied into the host app at install time.
Compiled output is byte-identical to the previous build; fonts and masked SVG icons resolve unchanged. All tests pass.