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

Multiple definitions of sprite #10

Closed
Munter opened this issue Jul 7, 2014 · 5 comments
Closed

Multiple definitions of sprite #10

Munter opened this issue Jul 7, 2014 · 5 comments

Comments

@Munter
Copy link
Member

Munter commented Jul 7, 2014

I have a setup where sprite sheets are defined in sass files that are included in multiple other toplevel sass files. The result is that each output css file has a redefinition of the same sprite sheet. I hit the "Multiple definitions of spriteGroupName sprite"-error.

Is there a way to avoid this?

Ideally I'd want assetgraph-sprite to handle this case more gracefully, but I'm also ok with having to do some manual workarounds in my assetgraph transform queue.

@Munter
Copy link
Member Author

Munter commented Jul 7, 2014

ping @papandreou

Just noticed you're not watching this repository :)

@papandreou
Copy link
Member

Hmm, could you post a complete example? It's happening because the compiled output of multiple .sass files end up including multiple occurrences of the same CSS rule with -sprite-selector-for-group: mySpriteGroup;?

I guess an easy fix would be to only emit that warning if there are multiple incompatible definitions, and somehow make sure that the CSS rules are merged together otherwise.

Just noticed you're not watching this repository :)

Whoopsie. Fixed :)

@Munter
Copy link
Member Author

Munter commented Jul 7, 2014

exactly. Think of the spriting stylesheet as a sass partial that get included in multiple output css files, which I try to model in the same graph.

There are both duplicate -sprite-selector-for-group-properties and implicit sprite declarations using the sprite= url parametres.

I was wondering if I could just iterate over my css assets and call the spriting transform asynchronously for each of them in order to avoid the clash.

@papandreou
Copy link
Member

Would still be nice to see a complete, boiled down example, including the expected output. At least it would make it easier for me to picture exactly what's going on.

It sounds like you intend for all the images to be added to different sprites? Maybe it could be handled with a sass variable that holds the sprite group name, and then put that as the value of the sprite parameter and -sprite-selector-for-group value?

@Munter
Copy link
Member Author

Munter commented Mar 4, 2015

I think I reduced the error message as good as possible. Closing

@Munter Munter closed this as completed Mar 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants