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

My styles are not applied on the development server #97

Closed deyemiobaa closed 1 year ago

deyemiobaa commented 2 years ago

Hello, I added cssbundling-rails to an existing rails project with the instructions provided. When I add styles via classes to my .html.erb files, they get added to the application.css after yarn build:css but when I start the rails server those changes don't reflect on the web.

html.erb file image

assets/builds/application.css file image

dev server image

jwilsjustin commented 2 years ago

Is the stylesheet loaded in the of your HTML page? You may need to add <%= stylesheet_link_tag "application" %> to your app/views/layouts/application.html.erb file.

abevoelker commented 2 years ago

Also if you're using Propshaft, be sure you didn't run rails assets:precompile or you'll be serving stale assets. You can reset things by running

$ rails assets:clobber
cesar82 commented 2 years ago

Hi, I am having same issue, it looks you need to run "yarn build:css" to get your css changes or use in other terminal "yarn build:css --watch"