Closed pastjean closed 9 years ago
Hi! Any suggestions how this should be fixed?
sorry im putting a description on whole problem and how to fix (pressed open to fast)
One part of the problem solution found here:
The fix i found was to put everything that is in a defs
tag in a global defs
tag for the whole file like this :
<svg xmlns="http://www.w3.org/2000/svg">
<!-- GLOBAL DEFS -->
<defs>
<linearGradient id="a" gradientUnits="userSpaceOnUse" x1="-49.131" y1="-138.442" x2="-48.401" y2="-138.442" gradientTransform="matrix(0 699.429 -612 0 -84503.281 34364.488)">
<stop offset="0" stop-color="#F7931E"/>
<stop offset="1" stop-color="#F2693E"/>
</linearGradient>
</defs>
<!-- Symbols here -->
<symbol id="logo" viewBox="0 0 446.9 512">
<path fill="url(#a)" d="M446.9 256L0 512V0z"/>
</symbol>
```
I'm experiencing the same problem, only on IE. I can provide sample SVG if needed.
The svg also need to be wrapped in a div that doesnt have display:none
but other ways to hide it
<div style="height: 0; width: 0; position: absolute; visibility: hidden">
<svg>...
</svg>
</div>
@pastjean thank you! I merged your PR with slight changes.
@pastjean do you need me to publish this on npm or it can wait until we fix #33?
Ohh! nice! no need I'm a patient guy, i'll use my branch meanwhile (or your master)
I had this same issue. problem was caused by display:none;
- for some reason if you load the page and have an svg that is initially display:none; and you want to show that svg on hover, in firefox and IE, this messes up any linear gradient that you have on the svg. just avoid using display:none. instead find another way to hide the svg - like using negative z-index's or absolutely position the svg off the page initially
@danielrussellLA have you tried the approach from the Readme https://github.com/w0rm/gulp-svgstore#inlining-svgstore-result-into-html-body
If you have an svg icon like this:
the generated svg :
the gradient wont show in ie and firefox
even worst if the svg (or any wrapping div) are set to display none it wont work ( another problem tough)