A
A
ayapergenov2016-02-02 08:09:32
Pug
ayapergenov, 2016-02-02 08:09:32

How to properly set up and set the path to the images in the sprite?

I use this build which is based on Gulp, Jade and Stylus.
In Gulp watch it is written that the pictures are collected in sprites

watch('app/sprites/**/*.png', () => gulp.start('sprites'));

What really happens and the sprite is generated in the folder dist/sprites/ I
prescribe the path to the image
background-image url(/images/sprites/sprites.png)
As a result, the image is not displayed, and Firebug shows such a path to the image.
Cannot GET /assets/styles/bg-page.png
Although in the development folder I put the image in the sprites folder

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Velichko, 2016-02-08
@Zoxon

Otherwise, you prescribe the gulp.spritesmith plugin generates, in addition to the sprite itself, also stylys mixins in which the offset is already specified.
This is the template https://github.com/CSSSR/spritesmith-stylus-retina... the
finished stylus file is placed in app/sprites
So call them

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question