The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › Other › SVG : DEFS before USE works for all SVG, but USE before DEFS doesn't
Tinkering with SVG I encountered a bug (?):
if my DEFS are defined before my USE tags, all my SVGs work well and renders has expected :
http://codepen.io/gfra/pen/DIhlj (both icons showing up)
But if DEFS are defined after USE tags, some SVG work, and some don’t :
http://codepen.io/gfra/pen/jLsBD (the G+ icon doesn’t show up)
Anybody know what the problem is ?
(I tested this on Chrome and Safari)
I’d have to read the spec (i.e., I do not know for certain), but that is what I would expect. Why would you be able to <use> something that doesn’t exist yet?
…perhaps someone else here knows for certain?
Well I thought like you but .. Some SVG are in fact rendering (cf. my use case presented with my two pens)
I think the bug only concerns shapes surrounded by G tags. Still testing it right now