Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stylus path problem #6

Closed
tiagoporto opened this issue Jan 27, 2015 · 6 comments
Closed

Stylus path problem #6

tiagoporto opened this issue Jan 27, 2015 · 6 comments
Assignees
Labels

Comments

@tiagoporto
Copy link
Contributor

Hello, i have the follow task in my gulpfile.js

gulp.task('svg-sprite', function() {
    gulp.src('src/images/svg-sprite/*.svg')
        .pipe(plumber())
        .pipe(svgSprite({
            mode : {
                css : {
                    dest : './',
                    sprite: '../images/svg-sprite.svg',
                    bust : false,
                    render : {
                        styl : {dest: '../../src/stylesheets/helpers/_svg-sprite.styl'}
                    }
                }
            }
        }))
        .pipe(gulp.dest('./public/images/'));
});

Works fine, the files are going to the right folders, and my .styl file generate this.

$svg-common 
    background-repeat no-repeat
    background-image url(..\images\svg-sprite.svg)

In the background-image the path is generated with backslash, when the stylus is compiled I have a problem, because they ignore the first backslash.

background-image: url("..imagessvg-sprite.svg");

Can someone help?

@jkphl
Copy link
Collaborator

jkphl commented Jan 27, 2015

Hey @tiagoporto,

thanks for reporting this. First of all, I assume you are on Windows, right? (Otherwise I'd wonder where the backslashes would come from ...). I must admit that I didn't test on Windows too thoroughly yet and that I'm not really familiar with Stylus at all, but maybe we can get that going without all this ...

Could you please try compiling the Stylus file and manually change the backslashes to regular slashes before. Does this work? I doubt the backslash is valid in this situation ... I'd then go and let svg-sprite consequently replace the backslashes.

Also, I remember there has been another similar issue once. I'll try to find it ...

Cheers,
Joschi

@jkphl jkphl self-assigned this Jan 27, 2015
@jkphl jkphl added the bug label Jan 27, 2015
@jkphl
Copy link
Collaborator

jkphl commented Jan 27, 2015

No, sorry, I mixed things. What I had in mind is the escape function that is part of the templating variables, but that serves a different purpose. I guess I'll have to replace backslashes in file paths altogether. Can you please confirm this?

@tiagoporto
Copy link
Contributor Author

Hello @jkphl, you are right. I am on windows 8.1.
When I change manually '' to '/', the stylus file is compiled perfectly.
In stylus the backslash is used for Char Escaping.

@jkphl
Copy link
Collaborator

jkphl commented Jan 27, 2015

Ok, thanks. Just what I thought. I'll try to push out a fix later today or tomorrow.

jkphl added a commit that referenced this issue Jan 28, 2015
@jkphl
Copy link
Collaborator

jkphl commented Jan 28, 2015

Should be fixed with release v1.0.13. Please let me know if this works for you (just did a very rough test on Windows today). I'll close the issue for now, but please feel free to re-open if you still have trouble with it.

@jkphl jkphl closed this as completed Jan 28, 2015
@tiagoporto
Copy link
Contributor Author

Problem solved.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants