Skip to content
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

phlex:install doesn’t add the Tailwind stylesheet to ApplicationLayout #135

Closed
ariel-codes opened this issue Jan 19, 2024 · 6 comments
Closed

Comments

@ariel-codes
Copy link

Even though the generator patches tailwind.config.js to scan Phlex components, Tailwind classes won’t work until you manually add stylesheet_link_tag “tailwind” to ApplicationLayout.

IMO if Phlex already knows you’re using Tailwind, it’s reasonable to expect it to work out-of-the-box. I’d also love to submit a PR for this

@joeldrapper
Copy link
Collaborator

Good point! This would be great.

@ibarreto
Copy link

Something I just noticed with the install_generator, it assumes that the Tailwind config lives under config/tailwind.config.js but by default in a new Rails app this config is just a file in the root of the app named tailwind.config.js. Would it be better to update that line to be:

TAILWIND_CONFIGURATION_PATH = Rails.root.join("tailwind.config.js")

?

I was wondering why Tailwind classes I was adding were not working when using my Phlex components and was able to track it down to that, my tailwind config wasn't updated when running bin/rails generate phlex:install

@joeldrapper
Copy link
Collaborator

@ibarreto I think that’s where the config used to be by default.

@joeldrapper
Copy link
Collaborator

The first part of this issue was fixed in #165. Open to pull requests adding the stylesheet link tag to ApplicationLayout.

@luiscobot
Copy link

I run the initial phlex generator but I got this warning

CleanShot 2024-04-07 at 01 54 55@2x

so my tailwind config file was not updated.

CleanShot 2024-04-07 at 01 55 38@2x

Which are the routes that I need to manually add to the content array?

@trinitytakei
Copy link
Contributor

@luiscobot did you figure this out in the end? If not - this depends on how you installed Tailwind, and ultimately, where your tailwind.config.js is. If you need further help, let us know (along with those details).

Once #204 lands in main, can you try and report any issues?

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

No branches or pull requests

5 participants