Answer the question
In order to leave comments, you need to log in
How to set up sass (compass) relative paths?
Hello.
gulpfile.js
gulp.task('compass', function() {
gulp.src(['./app/styles/*.sass', '!app/styles/lib/_*.sass'])
.pipe(compass({
css: 'public/css',
sass: 'app/styles',
style: 'compact',
images_dir: 'app/img/',
images_path: 'f:/progect/app/img/',
generated_images_dir: 'public/img/',
generated_images_path: 'f:/progect/public/img',
}))
.pipe(gulp.dest('public/css/'))
.pipe(connect.reload());
});
$icons: sprite-map("public/img/icons/*.png", $spacing: 10px)
// sized sprites
=image-size($path)
width: image-width($path)
height: image-height($path)
=sized-sprite($map, $sprite)
background: sprite($map, $sprite) no-repeat
@include image-size(sprite-file($map, $sprite))
=s($sprite, $map: $icons)
background: sprite($map, $sprite) no-repeat
//background-image: inline-image('icons/'+$sprite+'.png','image/png'); to switches sprites to base64, elegant
@include image-size(sprite-file($map, $sprite))
$icons: sprite-map("public/img/icons/*.png", $spacing: 10px)
- That's just with this path, he finds png, regardless of the config. Tried all options. Otherwise it throws an error. url('../img/public/img/icons-s19c8d80a14.png')
generated_images_path: 'f:/progect/public/',
to generated_images_path: 'f:/progect/',
url('../.../public/img/icons-s19c8d80a14.png')
As a result, the browser does not see the picture, because after leaving the styles folder it tries to find the Public folder. Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question