loading words...

Apr 17, 2019 23:31:14

Tailwind frustration

by @craigpetterson PATRON | 237 words | 309💌

Craig Petterson

Total posts: 309💌
Total words: 86150 (344 pages 📄)

I've been following this guide to install Tailwind in my app.

I cannot for the life of me get it to work.

I just want to try it.

All the steps seem fine and dandy up until the mention of `postcss.config.js`. I don't have that file. I tried making it and it didn't work.

It turns out that it conflicts with the old style `.postcssrc.yml` file that I do have! Huzzah progress. My app was initialised as Rails 5.2.2 with Webpacker 3.5.5, but this guide is for Rails 6 and Webpack 4.0

I tried several methods to get it working in either file. To no avail.

I start digging around trying to find out what on earth is going on. I make a new project and try the step again. It works! Why doesn't it work on my app?

I open up the source code that is being displayed and I notice the step that says to add the import to `packs/application.js` isn't working. It's not importing it. The comment I added is there, but then the next bit of code is an unrelated Stimulus file. God damnit!

My current situation is that I'm here with everything seemingly in order, just randomly searching the internet for clues.

The only thing I see wrong is my import from `packs/application.js` not working correctly:

// Tailwind
import '../css/application.css'
// End Tailwind

Gives me this output in the source code:

// Tailwind
// End Tailwind


From Craig Petterson's collection:

  • 1

    @craigpetterson -- stick with it .. write up a tutorial for others when you get it sorted. It'll seem obvious once you get the answer.

    Brian Ball avatar Brian Ball | Apr 17, 2019 21:04:02
    • 1

      @brianball That's a good idea. I'll definitely do that! Maybe one for my personal site.

      Craig Petterson avatar Craig Petterson | Apr 18, 2019 14:56:21
contact: email - twitter / Terms / Privacy