Skip to content

Commit 9ae47c9

Browse files
committed
Use hashed path for IDs in SVG sprites
Fix #74
1 parent 828f0e4 commit 9ae47c9

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/core.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export const defaults = {
6161
shape: {
6262
id: {
6363
generator(name, file) {
64-
return file.path;
64+
return new Buffer(file.path).toString('base64');
6565
}
6666
}
6767
},

src/factories/vector.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ export default function run(opts, images) {
3131
height: data.css.spriteHeight
3232
};
3333

34+
3435
data.css.shapes.forEach((shape) => {
35-
spritesheet.coordinates[shape.name] = {
36+
spritesheet.coordinates[new Buffer(shape.name, 'base64').toString()] = {
3637
width: shape.width.outer,
3738
height: shape.height.outer,
3839
x: shape.position.absolute.x,

0 commit comments

Comments
 (0)