Yesterday I started learning Tailwind CSS. I used DHH’s gem to install it under a Rails 6.1 site. It took literally minutes from zero, and I was up and running.
Tips for anyone learning:
- The tailwind settings are located in:
/app/javascript/stylesheets/tailwind.config.js
- Delete all scaffold css files from the
app/assets/stylesheets/
folder as they break tailwind - If you use HAML like I do, some classes that use the special character ‘/’, which can’t be applied directly, so you need to do this:
.various.classes.here{style: "w-1/2"}
, which is somewhat annoying but works and it’s quite rare anyway
I’m loving it so far, and considering switching from Bootstrap for any new sites I build once I’m proficient enough.
Questions:
- Do you have any experience with Tailwind CSS?
- I wonder if buying Tailwind UI elements is necessary to save time, or can one build their own elements fairly easily?
- Any tips you want to share on this subject?