-
Notifications
You must be signed in to change notification settings - Fork 181
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
Some tailwind styles not working out of the box in rails 7 #135
Comments
I noticed this too. Not sure if it's unique to me, but some of the margin styles were not applying (i.e. |
Hey @jinfiesto! Thanks for the demo repo. I've pulled your repo and run it. Everything works fine for me Are you booting up with |
Hi @dixpac. In case it is helpful, here is my I've noticed a few more styles not working out of the box consistently: (edit: removed css file for posterity + readability) |
No sure why it is not working for you, since as you can see in your |
Thanks, yeah, so that's the file in my repo. But what get's generated and served in the application is below (sorry, I should have included this above!). You'll see that there is a lot missing. (edit: removed CSS file for posterity and readability) |
Hi, sorry it took a second to get back. I didn't realize I needed to start the project up using bin/dev. Missed the section of the readme suggesting it. |
So, while this has resolved the issue presented in the test repo, I am now realizing that maybe it is not possible for me to upgrade my rails 6 app without excising tailwindcss and including tailwind in some other fashion. I see in the README, that tailwindcss does not support dynamic classnames. I use viewcomponents in another project. ViewComponents allow you to create componentized views with their own templates. I was previously using tailwindcss and it worked fine in my rails 6 project. After starting my project with bin/dev, it doesn't seem that any tailwind classes which I use in the viewcomponent templates are being added to the built tailwind output. Is it possible to get tailwindcss to look at those files or am I out of luck? |
I start the project using |
@jinfiesto did you configure tailwind config to look at the view component template files https://github.com/rails/tailwindcss-rails/blob/main/lib/install/tailwind.config.js#L5? @jordanful sure provide as much context as you can, there is not enough context atm on why this doesn't work for you, while it is working fine for the majority of other folks using the engine :) I'm glad to help if I can :) |
@dixpac many thanks for the attention. The fix for me: I ran |
Thanks @dixpac, I was being dumb. Your suggestion resolved the issue. Going to take a second to get used to this setup. Have been used to having all of tailwind available all the time. |
fwiw, I'm still encountering this every now and then. The fix above works, but thought I'd mention it. |
I have noticed that several tailwind styles are not working out of the box in rails 7. I have been using tailwindui components in a rails 6 project and in the process of upgrading to rails 7 seem to notice many of my styles are broken. Am I doing something wrong? This repository has an example, you can see the shadow class doesn't seem to apply, though many of the layout classes seem to work ok:
https://github.com/jinfiesto/tailwind-rails-bug
The text was updated successfully, but these errors were encountered: