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

Issue with Spritesmith & incorrect output #100

Open
pewuel opened this issue Apr 4, 2018 · 2 comments
Open

Issue with Spritesmith & incorrect output #100

pewuel opened this issue Apr 4, 2018 · 2 comments
Labels

Comments

@pewuel
Copy link

pewuel commented Apr 4, 2018

I'm using postcss-sprites with Laravel Mix.

Currently I have 2 issues:

  1. Generated images contain elements of other icons, so I decided to add spritesmith.padding, but it doesn't works. Sprite image output hasn't padding between images.

  2. I still got incorrect sprite output. For example icon--exit = icon--ring

Code sources, below:

webpack.mix.js:
Code on PasteBin

SCSS with icons:

.icon--exit { width: 18px; height: 18px; background: url('../images/sprites/icon-exit.svg') no-repeat 0 0; }
.icon--lock { width: 21px; height: 25px; background: url('../images/sprites/icon-ring.svg') no-repeat 0 0; }
.icon--ring { width: 12px; height: 12px; background: url('../images/sprites/icon-ring.svg') no-repeat 0 0; }

Have you similar problems?

@vvasilev-
Copy link
Member

Hi @pewuel,

Generated images contain elements of other icons, so I decided to add spritesmith.padding, but it doesn't works. Sprite image output hasn't padding between images.

The padding option doesn't work because you're using SVG instead of raster images like PNG, GIF.
You need to use the svgsprite option because SVG files are processed by a different engine.

I still got incorrect sprite output. For example icon--exit = icon--ring

In PasteBin I can see that you're using a custom onUpdateRule hook. Can you confirm that the problem still exists if default logic is used?

@pewuel
Copy link
Author

pewuel commented Apr 4, 2018

In PasteBin I can see that you're using a custom onUpdateRule hook. Can you confirm that the problem still exists if default logic is used?

I think SVG is useless in default logic. I'm using responsive spritesheets, because I wanna put custom width & height (SVG is pretty flexible). It looked good until I started adding more icons and noticed that they are mixed up...

How I can do it ?

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