0

Using Rails 7 with Propshaft and dartsass-rails. I've just migrated from sassc-rails to dartsass-rails which drops sprockets as the asset pipeline library

I have a background image declared in CSS with background-image: image-url('fancy_background.png'); the image is in app/assets/images/fancy_background.png

The image is not showing up in the assets folder. Other images which are declared in the HTML do get pulled in. How should I be referencing images in CSS with the "new" way?

Phil-6
  • 552
  • 6
  • 16

1 Answers1

0

The issue here was migrating from sprockets to propshaft.

Background images now need to be referenced with just url EG:

background-image: url('/fancy_background.png');

Source: https://github.com/rails/propshaft/blob/main/UPGRADING.md#3-migrate-from-sprockets-to-propshaft

Phil-6
  • 552
  • 6
  • 16