Skip to content

fix: unnecessary stylesheet_link_tag for tailwind#473

Merged
flavorjones merged 1 commit into
mainfrom
flavorjones-fix-stylesheet-link-tags
Jan 24, 2025
Merged

fix: unnecessary stylesheet_link_tag for tailwind#473
flavorjones merged 1 commit into
mainfrom
flavorjones-fix-stylesheet-link-tags

Conversation

@flavorjones

Copy link
Copy Markdown
Member

In Rails 8, propshaft detects :app and loads all the css files under app/assets/stylesheets, so we may not need this explicit tag for tailwind.

On installation, omit the tailwind stylesheet link tag if :app is already being passed to stylesheet_link_tag in the layout.

On upgrade, remove the tailwind stylesheet link tag if :app is already being passed to stylesheet_link_tag in the layout.

See related discussion at #412

In Rails 8, propshaft detects `:app` and loads all the css files under
app/assets/stylesheets, so we may not need this explicit tag for tailwind.

On installation, omit the tailwind stylesheet link tag if `:app` is
already being passed to stylesheet_link_tag in the layout.

On upgrade, remove the tailwind stylesheet link tag if `:app` is
already being passed to stylesheet_link_tag in the layout.
@flavorjones flavorjones force-pushed the flavorjones-fix-stylesheet-link-tags branch from be02dd2 to 7ae7a06 Compare January 24, 2025 17:36
@flavorjones flavorjones merged commit 9d30e2a into main Jan 24, 2025
@flavorjones flavorjones deleted the flavorjones-fix-stylesheet-link-tags branch January 24, 2025 17:44
@brunoprietog

Copy link
Copy Markdown

This doesn't seem to be the behavior we need, since, if you use Tailwind, the :app argument will include all *.css files inside app/assets. Here we are only interested in tailwind, which is the final build of all the CSS files you might have if you use @import.

With this, we'd be including default CSS files that have tailwind syntax that wouldn't be appropriate.

@brunoprietog

Copy link
Copy Markdown

Ignore me, just saw #474 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants