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

Passing --svg-dimattrs results in merged icons #138

Closed
ghost opened this issue Feb 1, 2016 · 6 comments
Closed

Passing --svg-dimattrs results in merged icons #138

ghost opened this issue Feb 1, 2016 · 6 comments
Assignees
Labels

Comments

@ghost
Copy link

ghost commented Feb 1, 2016

Hi,

first of all - great tool ;-)

But I found a problem. I use cli for my needs, this is my code:
svg-sprite --css-render-scss-dest _sprite.scss --css-example -cD . --cscss _img/*.svg
It works great. But when I add --svg-dimattrs=false, every generated icon looks the same (only scaled).

@jkphl jkphl added the bug label Feb 2, 2016
@jkphl jkphl self-assigned this Feb 2, 2016
@jkphl
Copy link
Collaborator

jkphl commented Feb 2, 2016

Thanks for reporting this @tomekbuszewski, I'll have a look into it as soon as I find some time!

@Johnius
Copy link

Johnius commented Feb 7, 2016

We just need to add background-size with resulting svg dims to each css class.

@jkphl
Copy link
Collaborator

jkphl commented Feb 8, 2016

@Johnius In how far does your need correspond to @tomekbuszewski's one? As far as I understood him, he's just not able to suppress the output of dimensions using the CLI tool.

@ghost
Copy link
Author

ghost commented Feb 8, 2016

I've made a screenshot of how it looks on preview, when I add --svg-dimattrs=false: https://www.dropbox.com/s/pguyz7lb3sufhb5/Screenshot%202016-02-08%2012.12.40.png?dl=0

Perhaps I just didn't understand some commands and/or I am using them in wrong combination. But this doesn't seem like a proper output.

@Johnius
Copy link

Johnius commented Feb 8, 2016

@jkphl As far as I understood — he wants to disable explicit setting of sprite dimensions in resulting svg.
Here's the difference between svg with --svg-dimattrs property enabled and disabled
But when he do that it raises wrong results in browser — as he mentioned above in screenshot. I got the same results when using --svg-dimattrs=false. After some digging it seems that we need background-size property on every css class containing our sprite in background property. It will fix @tomekbuszewski problem.

@jkphl
Copy link
Collaborator

jkphl commented Feb 8, 2016

OK guys, I think I finally got the problem. ;)

What seems to be buggy: The example document should either ignore that the dimension attributes have been disabled (i.e. a dimension attribute enabled sprite should be used for the example document), or the background size should be set as described.

In general, however, the result of --svg-dimattrs=false looks correct to me, and so does the browser behavior. So it's more the example document I've got to fix.

@jkphl jkphl closed this as completed in 1632a42 May 14, 2016
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