Skip to content

Code Completion for Tailwind classes in RubyMine and other JB IDEs #152

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

Closed
Wolwer1nE opened this issue Feb 26, 2022 · 4 comments
Closed

Comments

@Wolwer1nE
Copy link

After legacy file was removed, no more code completion is available in JB IDEs.
This plugin is not working (no npm -> no language server, that is reasonable), but previously IDE was able to detect class names from tailwind.css.

Maybe I am missing something, are there any way to use tailwind-rails and get code completion for class names without npm?

@dhh
Copy link
Member

dhh commented Feb 26, 2022

You can probably just download the full CSS file from TW and point the autocompleter at that?

@Wolwer1nE
Copy link
Author

@dhh Thank you, that is what I finally settled to. But I had to use full CSS version 2.2.19 because I can't find nothing newer: seems like https://cdn.tailwindcss.com provides script, not CSS directly. Scrolling through files of TW repo and npm installation folder also gave nothing. Probably, at this point it will be better to close this discussion and go to TW repo and ask for full file.

@gobijan
Copy link

gobijan commented Jan 30, 2023

This is not Rails fault. It is purely Jetbrains specific. Works for me in SublimeText or VSCode without problems with the bundled tailwind.

Temporary workaround:

  1. Install nodejs
  2. npm install tailwindcss postcss autoprefixer (in your project root folder)
  3. (optional): Add /node_modules, /package-lock.json and /package.json to your .gitignore

Now Rubymine offers completions and also respects the config/tailwind.config.js file.

@am1006
Copy link

am1006 commented May 5, 2023

This is not Rails, fault and is purely Jetbrains specific. Works for me in SublimeText or VSCode without problems with the bundled tailwind.

Temporary workaround:

  1. Install nodejs
  2. npm install tailwindcss postcss autoprefixer (in your project root folder)
  3. (optional): Add /node_modules, /package-lock.json and /package.json to your .gitignore

Now Rubymine offers completions and also respects the config/tailwind.config.js file.

This is a life saver! It works perfectly!

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

4 participants