Skip to content

Commit

Permalink
even more adjustments for source svgs
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreedm committed May 21, 2014
1 parent 1d06fed commit 9f3e76f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions concat-svg/concat-svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,17 @@ function read(file) {
function transmogrify($, name) {
var node = $('svg');
// remove spacer rectangles
node.find('rect[fill="none"], rect[style *= fill]').remove();
node.find('rect[fill], rect[style *= fill]').remove();
// remove fill colors
node.find('[fill]').each(function() {
var e = $(this);
$(this).removeAttr('fill');
var color = e.attr('fill');
// some "white" nodes are extraneous
if (color === '#FFFFFF') {
e.remove();
} else {
e.removeAttr('fill');
}
});
// remove empty groups
var innerHTML = $.xml(node.find('*').filter(':not(g)'));
Expand Down

0 comments on commit 9f3e76f

Please sign in to comment.