Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linear / radial gradients #185

Closed
OlehDutchenko opened this issue Aug 11, 2016 · 1 comment
Closed

linear / radial gradients #185

OlehDutchenko opened this issue Aug 11, 2016 · 1 comment
Assignees
Labels

Comments

@OlehDutchenko
Copy link

after create svg sprite - gradients disapear (((((

svg in has lineargradient with id = 'SVGID_1__FOR_icon_evernote_gradient'

<?xml version="1.0" encoding="utf-8"?> <svg version="1.0" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="icon_evernote_gradient" viewBox="0 0 100 100"><lineargradient id="SVGID_1__FOR_icon_evernote_gradient" gradientunits="userSpaceOnUse" x1="100" y1="100" x2="35" y2="35"><stop offset="0" style="stop-color:#000000;stop-opacity:0"></stop><stop offset="1" style="stop-color:#000000;stop-opacity:0.3"></stop></lineargradient><rect width="100" height="100"></rect><polygon fill="url(#SVGID_1__FOR_icon_evernote_gradient)" points="100.1,100.1 100.1,52.6 73.4,25.9 61.6,29.1 52,19.5 40.2,26.1 33.4,19.4 30.2,27.3 21.6,31.1 33.2,42.7 25.7,60.7 65.1,100.1 "></polygon><path fill="currentColor" d="M59.5,49.1c0-2.3,1.3-4.1,3.8-4c2.5,0.1,3.1,2.2,3.2,4.7 C64.2,49.2,62.3,48.5,59.5,49.1L59.5,49.1z M21.6,31.1c0.9-0.3,1.3-0.5,2.4-0.7c0.9-0.2,1.8-0.1,2.8-0.1c7.3,0,6.1,1.3,6-5.6 c-0.1-3.7,0-2.3,0.7-5.3c-0.9,0.5-7.4,7.4-9,8.8C23.7,29,22.2,30.3,21.6,31.1L21.6,31.1z M53.5,22.5c-0.5-2.7-1.9-3.9-4.5-4.6 c-3.4-0.9-12.1-1.7-13.8,3c-0.6,1.7-0.2,6.3-0.2,8.5c0,1.9-1.2,2.6-3.1,2.6c-4.9,0-11.5-1-11.5,5.2c0,4.6,2.2,17.7,4.3,21.9 c1.1,2.2,2.3,2.5,4.9,3.3c3.1,1,10.8,2.6,14.1,2.7c1.7,0.1,2.3-0.3,2.9-1.3c0.9-1.5,1.6-4.7,1.8-6.6c0.1-1-0.1-2.9,0.4-3.6 c0.3,0.8-0.5,6.5,3.5,8c7.2,2.8,13-1.8,13.1,10c0.1,5-1,5.5-5.9,5.5c-2.5,0-5.3,0.3-5.6-2.2c-0.4-3.7,1.9-3,4.9-3.3 c0-0.8-0.2-1.5-0.2-2.4c0-1,0.5-1.3,0.3-2.2c-6.1-0.5-10.7,0.2-10.7,7.8c0,7.1,2.5,9.2,10.1,9.2c5.2,0,9.5,0.6,12.3-3.4 c4-5.8,5.9-20.7,5.9-27.6c0-4.2-0.7-21.7-1.8-25.1c-1.2-3.8-4.3-4.1-8.6-4.8C61.9,22.6,57.7,22.3,53.5,22.5z"></path></svg>

svg out no gradient element and path has attr fill="url(#a)"

<symbol viewBox="0 0 100 100" id="icon-evernote_gradient"><path d="M0 0h100v100H0z"/><path fill="url(#a)" d="M100.1 100.1V52.6L73.4 25.9l-11.8 3.2-9.6-9.6-11.8 6.6-6.8-6.7-3.2 7.9-8.6 3.8 11.6 11.6-7.5 18 39.4 39.4z"/><path fill="currentColor" d="M59.5 49.1c0-2.3 1.3-4.1 3.8-4 2.5.1 3.1 2.2 3.2 4.7-2.3-.6-4.2-1.3-7-.7zm-37.9-18c.9-.3 1.3-.5 2.4-.7.9-.2 1.8-.1 2.8-.1 7.3 0 6.1 1.3 6-5.6-.1-3.7 0-2.3.7-5.3-.9.5-7.4 7.4-9 8.8-.8.8-2.3 2.1-2.9 2.9zm31.9-8.6c-.5-2.7-1.9-3.9-4.5-4.6-3.4-.9-12.1-1.7-13.8 3-.6 1.7-.2 6.3-.2 8.5 0 1.9-1.2 2.6-3.1 2.6-4.9 0-11.5-1-11.5 5.2 0 4.6 2.2 17.7 4.3 21.9 1.1 2.2 2.3 2.5 4.9 3.3 3.1 1 10.8 2.6 14.1 2.7 1.7.1 2.3-.3 2.9-1.3.9-1.5 1.6-4.7 1.8-6.6.1-1-.1-2.9.4-3.6.3.8-.5 6.5 3.5 8 7.2 2.8 13-1.8 13.1 10 .1 5-1 5.5-5.9 5.5-2.5 0-5.3.3-5.6-2.2-.4-3.7 1.9-3 4.9-3.3 0-.8-.2-1.5-.2-2.4 0-1 .5-1.3.3-2.2-6.1-.5-10.7.2-10.7 7.8 0 7.1 2.5 9.2 10.1 9.2 5.2 0 9.5.6 12.3-3.4 4-5.8 5.9-20.7 5.9-27.6 0-4.2-.7-21.7-1.8-25.1-1.2-3.8-4.3-4.1-8.6-4.8-4.2-.5-8.4-.8-12.6-.6z"/></symbol>

@jkphl jkphl added the question label Aug 11, 2016
@jkphl jkphl self-assigned this Aug 11, 2016
@jkphl
Copy link
Collaborator

jkphl commented Aug 11, 2016

@dutchenkoOleg This is not a bug of svg-sprite itself but rather a limitation with sprites, <symbol> elements and gradients. Please read #74 and adjacent issues. At some point I might consider adding a feature extracting the gradients and putting them in a single <defs> block but that won't be anytime soon, unfortunately.

Btw as far as I know also your <lineargradient> should be wrapped in a <defs> element, see https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Gradients.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants