rails / cssbundling-rails

Bundle and process CSS in Rails with Tailwind, PostCSS, and Sass via Node.js.
MIT License
579 stars 83 forks source link

Tailwind text color utility classes missing #104

Closed alexhanh closed 2 years ago

alexhanh commented 2 years ago

Steps to reproduce:

Run rails new tailwind_test -c tailwind Run bin/rails generate controller Articles index Add root "articles#index" to routes.rb Replace app/views/articles/index.html.erb with <h1 class="text-red-500">Hello, Rails!</h1> Run bin/rails server and browse to http://localhost:3000

I expect the header to be red, but it's black instead. Am I missing something?

When I check http://localhost:3000/assets/tailwind-9feb1537dce11964234c16da844286da8664b423b40520df83683b2ce14c0961.css the Tailwind css is missing all the text utility classes and http://localhost:3000/assets/application-fe440406e54bdd95ec9046fd7f7b3f6803f9748857226012c8213a74c8350ae1.css contains

@tailwind base;
@tailwind components;
@tailwind utilities;

as if something wasn't resolved. I also tried running yarn build:css --watch in the project root dir, but that fails with error Couldn't find a package.json file in XXX.

This is on Rails 7.0.4, Ruby 3.1.2p20 and npm 8.19.2

alexhanh commented 2 years ago

Running bin/dev as per documentation got it working.