We've moved discussions to Discord

disregard: what causes OMISSION ALL tailwind's NAMED-color classes (...blue... for example) from assets, from ALL environments, while everything else seems fine?

solved: I think the issue was related to styles used inside a partial that was missing the ".html" in the name eg "_something.haml" or "_something.erb" worked fine in Rails, but, did not match the pattern of the Tailwind purge command which assumed "*.html.erb" or "*.html.haml"

Why would ALL TW named-color classes (used on a couple of pages) suddenly disappear from assets? And more importantly how can one guarantee that TW classes that are used will be reliably included in assets?

In development and also in staging/production (Heroku the system just decided to stop compiling including ALL Tailwind named-color classes.

And the primary concern is if THOSE in-use classes are silently omitted, what ELSE is being omitted?

For example, the following classes were simply NOT in assets, according to both Chrome and Firefox inspectors: bg-purple-900, text-purple-100. They were for the prior 100 or so commits.

Colors like bg-secondary-500 and text-primary-700 were OK, ONLY the classes that used named-colors (purple, green, etc) were omitted.

I tried `bundle exec rails webpacker:clobber` just to see if that helped. (No good.) Of course first thing I tried was completely shutdown and restart my Mac. (No good.) I also tried skipping `foreman start` and running all processes in separate terminal windows. (No good.)

That entire swatch of TW classes were missing in both production and development? I suspected purge.css, but that should NOT affect development right?

# app/javascript/stylesheets/tailwind.config.js
  // Purge unused TailwindCSS styles
  purge: {
    enabled: ["production", "staging"].includes(process.env.NODE_ENV),
    content: [
      './**/*.html.erb',
      './**/*.html.haml',
      './app/helpers/**/*.rb',
      './app/javascript/**/*.js',
    ],
  },


What seems odd is if I add a new DUMMY page that uses some of those TW named-color classes, NOW the classes get added into the assets.

But to say the least that is not a reliable workaround to have to manually track down and re-use every since TW class used elsewhere in the app.

What it used to look like... TW named-colors worked as expected...

Hospice_Inbox.jpg 259 KB


What it looks like (unless I add a NEW page using the same named-color styles):

Hospice_Inbox.jpg 343 KB
Notifications
You’re not receiving notifications from this thread.