sass / sassc-rails

Integrate SassC-Ruby with Rails!
MIT License
707 stars 104 forks source link

Problem with adding a png background #172

Open LightningRpper opened 2 years ago

LightningRpper commented 2 years ago

I'm trying to add in a png called "lightning background.png" as a background to my website. I have the image in app/assets/images and this as my code for the body section of app/stylesheets/scaffolds.

body {
  background-color: #fff;
  //color: #333;
  color: white;
  margin: 33px;
  background-image: image-url('lightning background.png');
  background-repeat: no-repeat;
  background-size: 100%; 
}

However, I am getting an error that says

Error: error in C function image-url: bad URI(is not URI?): "lightning background.png"
        on line 6:21 of app/assets/stylesheets/scaffolds.scss, in function `image-url`
        from line 6:21 of app/assets/stylesheets/scaffolds.scss
>>   background-image: image-url('lightning background.png');

and its pointing me in the direction of line 9 of app/views/layouts/application.html.erb. <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>

What's the issue here and how can I adjust it to give the website more of a proper background?

johnnyshields commented 1 year ago

FYI I'm maintaining dartsass-sprockets which is a fork of this gem. You can try it and see if your issue is resolved; it uses a different engine (Dart Sass) under-the-hood. If not, please file an issue there.