Skip to content

Commit

Permalink
solving problem with <defs> inside <symbol> for webkit-based browsers #…
Browse files Browse the repository at this point in the history
  • Loading branch information
leungwensen committed Aug 5, 2016
1 parent 164c346 commit 7dc9e99
Show file tree
Hide file tree
Showing 33 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion dist/sprite/symbol/ant.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dist/sprite/symbol/awesome.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dist/sprite/symbol/bootstrap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dist/sprite/symbol/dev.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dist/sprite/symbol/elusive.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dist/sprite/symbol/entypo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dist/sprite/symbol/evil.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dist/sprite/symbol/flag.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dist/sprite/symbol/flat.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dist/sprite/symbol/foundation.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dist/sprite/symbol/geom.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dist/sprite/symbol/icomoon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dist/sprite/symbol/ionic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dist/sprite/symbol/logos.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dist/sprite/symbol/maki.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dist/sprite/symbol/map.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dist/sprite/symbol/material.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dist/sprite/symbol/metro.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dist/sprite/symbol/mfglabs.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dist/sprite/symbol/oct.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dist/sprite/symbol/open.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dist/sprite/symbol/payment-web.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dist/sprite/symbol/payment.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dist/sprite/symbol/simple.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dist/sprite/symbol/subway.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dist/sprite/symbol/typcn.svg

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/sprite/symbol/weather.svg

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/sprite/symbol/windows.svg

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/sprite/symbol/zero.svg

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/sprite/symbol/zocial.svg

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion gulp/svg-sprite.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function reduceAttrs() {
gutil.log(file.path);
const doc = domParser.parseFromString(file.contents.toString('utf8'));
const svgElement = doc.getElementsByTagName('svg')[0];
svgElement.setAttribute('style', 'display:none;');
svgElement.setAttribute('style', 'width:0;height:0;position:absolute;opacity:0;');
file.contents = new Buffer(doc.toString());
} catch (err) {
this.emit('error', new gutil.PluginError('svg-sprite', err.toString()));
Expand Down
2 changes: 1 addition & 1 deletion lib/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module.exports = (options) => {
symbols.push(svg2symbol(svgContent, id));
});

const svgSprite = `<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="display:none;">${symbols.join('')}</svg>`;
const svgSprite = `<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="width:0;height:0;position:absolute;opacity:0;">${symbols.join('')}</svg>`;

fs.writeFileSync(path.join(targetPath, 'svg-symbols.svg'), svgSprite, 'utf8');
fs.writeFileSync(path.join(targetPath, 'index.html'), template({
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ $('#download').on('click', () => {
}
return '';
});
const svgSprite = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="display:none;">${symbols.join('')}</svg>`;
const svgSprite = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="width:0;height:0;position:absolute;opacity:0;">${symbols.join('')}</svg>`;
const blob = new Blob([
svgSprite
], {
Expand Down

0 comments on commit 7dc9e99

Please sign in to comment.