Skip to content

Conversation

flavorjones
Copy link
Member

@flavorjones flavorjones commented Jan 24, 2025

This file should not be included in the stylesheet link tags served to user agents. But by default, Rails 8 apps add a tag for all CSS files under app/assets (courtesy of a Propshaft feature handling a source named :all), and so this file is being included unintentionally.

Going forward, in version 4.x of this gem (which pins to Tailwind v4), the installer will place the file into app/assets/tailwind. The upgrader will move it from app/assets/stylesheets to app/assets/tailwind.

And the gem's railtie adds app/assets/tailwind to config.assets.excluded_paths to make sure it doesn't get served up by the stylesheet_link_tags :app call in the application layout.

This is being tested with both Rails 7.2 (without Propshaft) and Rails 8 (with Propshaft) and it looks good.

Fixes #470

This file should not be included in the stylesheet link tags served to user agents. Fixes #470
@flavorjones flavorjones force-pushed the flavorjones-move-application-tailwind-css branch from 169e7f0 to 31621ea Compare January 24, 2025 18:50
@flavorjones flavorjones requested a review from dhh January 24, 2025 18:56
@flavorjones
Copy link
Member Author

I'm not positive this is the best possible implementation of a fix, but I'm feeling a bit of time pressure and this is good enough to ship in a second release candidate.

@flavorjones flavorjones merged commit a0eaafa into main Jan 26, 2025
17 checks passed
@flavorjones flavorjones deleted the flavorjones-move-application-tailwind-css branch January 26, 2025 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant