-
Notifications
You must be signed in to change notification settings - Fork 187
Missing documentation about tailwind.config.js customization #25
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
Comments
Thank you for this. I was looking exactly this. |
Helpful! |
Feel free to turn this into a PR that performs those steps 👍 |
Thank for this. I'm curious about doing this with the Asset Pipeline, as I'm trying to avoid Webpack 🙏 I'd like to add a |
Yeah, ignore all that. I had an old version of node (~10.x) that was causing issues. |
I was trying to customize Tailwind CSS via
tailwind.config.js
and looking for the proper way to do it I saw you wrote this:I followed all the steps in the Tailwind CSS documentation but I didn't get it to work so I made a little research and I found there're some additional steps to accomplish before it works with Rails.
Once you've installed the gem:
npx tailwindcss init
tailwind.config.js
file somewhere inside your./app/javascript
folder in order the file to be packed for Rails (important).postcss.config.js
to tell Webpacker where is the new file located:require('tailwindcss')('./app/javascript/tailwind.config.js'),
tailwind.config.js
file from this repo, important to add the packages@tailwindcss/forms
,@tailwindcss/aspect-ratio
,@tailwindcss/typography
topackage.json
and install.The main problem I found was that Tailwind CSS documentation explains that the
tailwind.config.js
file is going to be searched (firstly) in the root of the project and currently in Rails this is definitely not going to happen.I think this could be confusing and frustrating for people so maybe documentation should cover it as I guess customizing your Tailwind CSS boilerplate may be very common.
The text was updated successfully, but these errors were encountered: