PolymerElements / iron-iconset-svg

Represents a source of icons expressed as a collection of inline SVGs
https://www.webcomponents.org/element/PolymerElements/iron-iconset-svg
37 stars 34 forks source link

Not sure how to put my SVG into this structure #26

Closed ghost closed 8 years ago

ghost commented 8 years ago

I have an SVG, but when i look at the demo twitter icon, the format is completely different Can you give me some advise here please.

Here is my SVG:

<?xml version="1.0" encoding="utf-8"?>

<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="129px" height="40.5px" viewBox="223.14 367.445 129 40.5" enable-background="new 223.14 367.445 129 40.5" xml:space="preserve">

So looking at the demo the vector format looks completly differerent:

akc42 commented 8 years ago

It seems you put single elements into this. mostly the tag is a group of elements put together. I notice that the demo twitter tag is a single tag, so I presume that works as well. (Just to clarify, this element takes several single elements at the top level, each one with an id that defined the icon name. You can of course nest multiple elements under each single element).

I just created an icon for use using inkscape, and found when I opened the svg file it had created, it had grouped an entire layer together with a tag. Since this was the only layer I took this and added the id attribute to give it a name..

One problem I them had was that each of the elements had a style on them. This seems to effect the styling Polymer was trying to apply, so I manually deleted these styles, and that solved that problem.

I created the icon at 48 x 48 according to inkscape, but when I put size=48 into the appropriate attribute on this iron-iconset-svg element I only got the top quarter of it. Changing this to size 96 solve the problem, although I have no idea why

ghost commented 8 years ago

hmm. Ok thanks for the tips.

I will give it another shot based on the bits of advice you gave me.