vigetlabs / gulp-rails-pipeline

Ditch the Rails Asset Pipeline and roll your own with Gulp
MIT License
646 stars 64 forks source link

Doesn't compile image-url sprockets helper #48

Closed Hirurg103 closed 6 years ago

Hirurg103 commented 8 years ago

I cloned the project, installed gems/npm packages, compiled assets and opened http://localhost:3000/

I see the following in my browser: screen shot 2016-03-09 at 1 28 41 pm

When I open the compiled public/assets/stylesheets/global.css I see

body {
  background: #dd3435 image-url("gulp.png");
  font-family: sans-serif; }

which is an invalid CSS rule. When I fix image-url to url manually and open the page again I see the following

screen shot 2016-03-09 at 1 32 14 pm

I could change the background rule in the global.sass to

background: #dd3435 url('gulp.png')

but seems that it won't work in the production because of the digest in the image filename

How can we fix this issue? Do you have any ideas?

greypants commented 8 years ago

Oh man. Yeah, image-url used to be a thing in node-sass a long time ago. It's since been deprecated. It should be removed in favor of putting the full asset path a regular url() declaration.

background: #dd3435 url("assets/images/gulp.png");

This repo is in need of an update. In the meantime, you can reference https://github.com/vigetlabs/gulp-starter for a more up to date tasks and dependencies.

Hirurg103 commented 8 years ago

OK, thank you very much @greypants !

greypants commented 8 years ago

We can leave this open, as I need to update the example code.

chrisvanpatten commented 7 years ago

Worth noting that you can also use the node-sass-asset-functions library to maintain this functionality.

soundasleep commented 7 years ago

I couldn't get the background image to work unless I changed the SASS to:

background: #dd3435 url("images/gulp.png")