bigcommerce / cornerstone

The BigCommerce Cornerstone theme
https://developer.bigcommerce.com/stencil-docs
287 stars 604 forks source link

SVG icons breaking icon-sprite.svg #1246

Open nowlena opened 6 years ago

nowlena commented 6 years ago

Expected behavior

When generating icon-sprite.svg via grunt svgstore the sprite should load properly.

Actual behavior

The svg.icons-svg-sprite src gets set to (Unknown) instead of the SVG sprite as intended.

The reason: icon-sprite.svg cannot be loaded due to Namespace prefix sketch for type on path is not defined

I was able to fix the issue by stripping down (ie. removing the "mask" and " sketch:type" attributes) the following SVGs:

Steps to reproduce behavior

Nothing specific, when running the Theme this issue occurred both locally and when bundling then applying to a storefront.

xpothemes commented 6 years ago

same issue

karen-white commented 6 years ago

@nowlena @xpothemes I'm having some trouble reproducing this. Could you give me a little more info on the theme version you're using and the exact steps you took when you saw the issue? Thanks!

nowlena commented 6 years ago

Note the source attr: svg-issue

Some additional information: Theme Version: 2.0.0 OS: WIndows 10 Pro Browsers: Chrome 66, Firefox 60, Edge 42

Steps taken to reproduce error:

karen-white commented 6 years ago

Thank you, @nowlena ! I'm seeing the issue now. I'll get a ticket in for this so we can address it.

sungsation commented 6 years ago

same issue

lucisousa commented 6 years ago

same issue here too

techxlers commented 6 years ago

Still facing the same issue. Any solution?

junedkazi commented 6 years ago

@techxlers the solution is in code review here https://github.com/bigcommerce/cornerstone/pull/1258. Hopefully it should be merged in a day or 2.

techxlers commented 6 years ago

@junedkazi Thanks. BTW I am able to solve the issue by removing following "mask", "sketch:type", "sketch:name", "xlink". Icons are working now :)

PeteyRev commented 6 years ago

Same issue here. Tried implementing fix in #1258 but no luck

techxlers commented 6 years ago

@PeteyRev Did you try my fix?

PeteyRev commented 6 years ago

@techxlers I did except for the "remove xlink" - Where are you removing that, on the icon files themselves, or when you are adding to html:

<svg>
    <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-chevron-left"></use>
</svg>
techxlers commented 6 years ago

@PeteyRev Go to assets/img/icon-sprite.svg file. Open that file in any editor and then find the words which I have mentioned in my previous comment and then simply delete those tags.

PeteyRev commented 6 years ago

@techxlers perfect, thanks! Had to delete the mask element from stumbleupon.svg and its working now

nowlena commented 6 years ago

For reference, my initial post here explains how to fix the issue:

I was able to fix the issue by stripping down (ie. removing the "mask" and " sketch:type" attributes) the following SVGs:

  • instagram.svg
  • stumbleupon.svg
PeteyRev commented 6 years ago

@nowlena thanks, I think I may have overlooked that initially. Not enough coffee today

junedkazi commented 6 years ago

Is this still an issue on the latest cornerstone ?

PeteyRev commented 6 years ago

@junedkazi this was an issue for me on version 2.1, so I think so

aisflat439 commented 6 years ago

This is still an issue in 2.2

This still works on 2.2

I was able to fix the issue by stripping down (ie. removing the "mask" and " sketch:type" attributes) the following SVGs:

instagram.svg
stumbleupon.svg
Bobspadger commented 3 years ago

I am having this same issue on the latest version - is there any update on this?