{"action":"created","issue":{"url":"https://api.github.com/repos/jkphl/svg-sprite/issues/121","labels_url":"https://api.github.com/repos/jkphl/svg-sprite/issues/121/labels{/name}","comments_url":"https://api.github.com/repos/jkphl/svg-sprite/issues/121/comments","events_url":"https://api.github.com/repos/jkphl/svg-sprite/issues/121/events","html_url":"https://github.com/jkphl/svg-sprite/issues/121","id":115947974,"number":121,"title":"Request a property to remove SVG fill attribute","user":{"login":"cshold","id":1730309,"avatar_url":"https://avatars.githubusercontent.com/u/1730309?v=3","gravatar_id":"","url":"https://api.github.com/users/cshold","html_url":"https://github.com/cshold","followers_url":"https://api.github.com/users/cshold/followers","following_url":"https://api.github.com/users/cshold/following{/other_user}","gists_url":"https://api.github.com/users/cshold/gists{/gist_id}","starred_url":"https://api.github.com/users/cshold/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cshold/subscriptions","organizations_url":"https://api.github.com/users/cshold/orgs","repos_url":"https://api.github.com/users/cshold/repos","events_url":"https://api.github.com/users/cshold/events{/privacy}","received_events_url":"https://api.github.com/users/cshold/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jkphl/svg-sprite/labels/question","name":"question","color":"cc317c"},{"url":"https://api.github.com/repos/jkphl/svg-sprite/labels/wontfix","name":"wontfix","color":"ffffff"}],"state":"closed","locked":false,"assignee":{"login":"jkphl","id":4446936,"avatar_url":"https://avatars.githubusercontent.com/u/4446936?v=3","gravatar_id":"","url":"https://api.github.com/users/jkphl","html_url":"https://github.com/jkphl","followers_url":"https://api.github.com/users/jkphl/followers","following_url":"https://api.github.com/users/jkphl/following{/other_user}","gists_url":"https://api.github.com/users/jkphl/gists{/gist_id}","starred_url":"https://api.github.com/users/jkphl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkphl/subscriptions","organizations_url":"https://api.github.com/users/jkphl/orgs","repos_url":"https://api.github.com/users/jkphl/repos","events_url":"https://api.github.com/users/jkphl/events{/privacy}","received_events_url":"https://api.github.com/users/jkphl/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2015-11-09T19:30:38Z","updated_at":"2015-11-12T16:26:40Z","closed_at":"2015-11-09T19:57:20Z","body":"First off, great script - very helpful for managing icons after being in icon font world for a long time.\r\n\r\nThe issue is that setting a `fill` colour via CSS on an SVG element doesn't overwrite the one defined inside the SVG itself.\r\n\r\nMy thinking was that using `inline: true` would also remove all fill attributes, but on second though it should probably be its own property. Thoughts?\r\n\r\nCurrent setup via `gulp-svg-sprite`:\r\n```\r\ngulp.src(paths.srcIcons)\r\n  .pipe(svgSprite({\r\n    mode: {\r\n      symbol: {\r\n        inline: true,\r\n        sprite: 'icon-sprite.svg',\r\n        dest: '.'\r\n      }\r\n    }\r\n  }))\r\n  .pipe(gulp.dest(paths.destSnippets));\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/jkphl/svg-sprite/issues/comments/156155668","html_url":"https://github.com/jkphl/svg-sprite/issues/121#issuecomment-156155668","issue_url":"https://api.github.com/repos/jkphl/svg-sprite/issues/121","id":156155668,"user":{"login":"jkphl","id":4446936,"avatar_url":"https://avatars.githubusercontent.com/u/4446936?v=3","gravatar_id":"","url":"https://api.github.com/users/jkphl","html_url":"https://github.com/jkphl","followers_url":"https://api.github.com/users/jkphl/followers","following_url":"https://api.github.com/users/jkphl/following{/other_user}","gists_url":"https://api.github.com/users/jkphl/gists{/gist_id}","starred_url":"https://api.github.com/users/jkphl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkphl/subscriptions","organizations_url":"https://api.github.com/users/jkphl/orgs","repos_url":"https://api.github.com/users/jkphl/repos","events_url":"https://api.github.com/users/jkphl/events{/privacy}","received_events_url":"https://api.github.com/users/jkphl/received_events","type":"User","site_admin":false},"created_at":"2015-11-12T16:26:40Z","updated_at":"2015-11-12T16:26:40Z","body":"@cshold Sorry for not responding earlier, I'm just totally slammed with tasks at the moment.\r\n\r\nFirst, I have no idea where you got that nasty `shape.svg.current` option from. AFAIK no such thing exists. ;)\r\n\r\nWhat you're using in your setup is a *shape based transformation* that gets applied **before** the actual sprite generation as an \"optimization step\" (just at the same stage when also SVGO gets applied, which — by the way — gets skipped if you don't re-include it in your custom `shape.transform` list; you'd probably want something like `shape.transform: ['svgo', {custom: function(){ /*...*/ }}]`). Changes that you make on the shape's `<svg>` element might get lost during sprite compilation as the `<svg>` element gets [substituted with a `<symbol>` element](https://github.com/jkphl/svg-sprite/blob/master/lib/svg-sprite/mode/symbol.js#L55) and only a certain [list of attributes](https://github.com/jkphl/svg-sprite/blob/master/lib/svg-sprite/mode/symbol.js#L16) is copied over from the `<svg>` element (with `class` being in this list btw).\r\n\r\nSo, if your `<svg>` element doesn't carry the desired class from the begining, you will need to use a  [global transformation](https://github.com/jkphl/svg-sprite/blob/master/docs/configuration.md#svg-sprite-customization) that gets applied **after** the sprite got created. You may configure that using the `svg.transform` list and possibly use a regex matching the `<symbol>` elements here to inject the class names.\r\n\r\nI hope this helped a little to get you on track‽ Good luck! :)"}}