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

fix(tailwindcss): fix TailwindCSS pack not loading when using tailwindcss-rails Ruby Gem #915

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

natematykiewicz
Copy link
Contributor

📑 Description

#912 caused the Tailwind LSP to not work, when using the tailwindcss-rails Ruby gem.

The tailwindcss-rails Ruby gem keeps the config at config/tailwind.config.js, which is not in the new root_dir config.

https://github.com/rails/tailwindcss-rails?tab=readme-ov-file#configuration-and-commands

The tailwindcss-rails Ruby gem keeps the config at config/tailwind.config.js
https://github.com/rails/tailwindcss-rails
Copy link

github-actions bot commented Apr 25, 2024

Review Checklist

Does this PR follow the [Contribution Guidelines](development guidelines)? Following is a partial checklist:

Proper conventional commit scoping:

  • If you are adding a new plugin, the scope would be the name of the category it is being added into. ex. feat(utility): added noice.nvim plugin

  • If you are modifying a pre-existing plugin or pack, the scope would be the name of the plugin folder. ex. fix(noice-nvim): fix LSP handler error

  • Pull request title has the appropriate conventional commit type and scope where the scope is the name of the pre-existing directory in the project as described above

  • README is properly formatted and uses fenced in links with <url> unless they are inside a [title](url)

  • Proper usage of opts table rather than setting things up with the config function.

@natematykiewicz natematykiewicz changed the title Fix TailwindCSS pack not loading when using tailwindcss-rails Ruby Gem fix(pack): TailwindCSS pack not loading when using tailwindcss-rails Ruby Gem Apr 25, 2024
@natematykiewicz natematykiewicz changed the title fix(pack): TailwindCSS pack not loading when using tailwindcss-rails Ruby Gem fix(pack): fix TailwindCSS pack not loading when using tailwindcss-rails Ruby Gem Apr 25, 2024
@natematykiewicz natematykiewicz changed the title fix(pack): fix TailwindCSS pack not loading when using tailwindcss-rails Ruby Gem fix(tailwindcss): fix TailwindCSS pack not loading when using tailwindcss-rails Ruby Gem Apr 25, 2024
Copy link
Member

@mehalter mehalter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mehalter mehalter merged commit 6626739 into AstroNvim:main Apr 25, 2024
21 of 22 checks passed
@natematykiewicz natematykiewicz deleted the nate/fix_tailwind_rails branch April 25, 2024 15:57
@rafaelderolez
Copy link
Contributor

Sorry about that!

This actually made me go look at the docs and it seems custom config location and names are supported: https://tailwindcss.com/docs/configuration#using-a-different-file-name.

We could consider adding a statement to check package.json for a tailwindcss key, and the equivalent for Ruby projects (and others?).

Thoughts? @mehalter @natematykiewicz

@natematykiewicz
Copy link
Contributor Author

natematykiewicz commented Apr 29, 2024

No problem. I sort of wish they didn’t change the default location of the config. But I also get it, every other Rails config is in the config directory.

The Ruby gem doesn’t use package.json. It includes a compiled executable and some Ruby config. It actually exists for Rails apps that want to use Tailwind but have no other need for NodeJS.

@natematykiewicz
Copy link
Contributor Author

FWIW, the official Tailwind guides mention this config file.

https://tailwindcss.com/docs/guides/ruby-on-rails

@treshenry
Copy link
Contributor

And... Elixir Phoenix projects put the tailwind config at assets/tailwind.config.js. https://github.com/phoenixframework/tailwind

Could not figure out what broke, and had to go digging. 🤷‍♂️ I'll put up a PR shortly.

treshenry added a commit to treshenry/astrocommunity that referenced this pull request Sep 7, 2024
See also AstroNvim#915

Phoenix projects put the tailwind.config.js file in the root /assets
folder. The addition of specific root dir detection in AstroNvim#912 broke the
elixir-phoenix pack.
Uzaaft pushed a commit that referenced this pull request Sep 9, 2024
#1196)

See also #915

Phoenix projects put the tailwind.config.js file in the root /assets
folder. The addition of specific root dir detection in #912 broke the
elixir-phoenix pack.
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.

4 participants