Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Iconfont or svg?

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers.
Avatar for Justin Slack Justin Slack
August 23, 2015

Iconfont or svg?

Lightning talk at CTEDs workshop - august 2015.

Avatar for Justin Slack

Justin Slack

August 23, 2015
Tweet

Other Decks in Design

Transcript

  1. Icon systems • pngs • png sprites • Weird javascript

    to make transparency work in IE6 • Retina problems
  2. SVG • Can be displayed through the use of CSS

    Backgrounds, <object> tags, <img> tags, or inlined directly into your HTML
  3. SVG • Inline SVG is right in the document. If

    the browser supports it, it displays it.
  4. <svg class="iconsvg"> <g> <polygon fill="#ad3429" points="217.14,14.856 169.039,14.856 235.993,147.185 260.045,99.649"></polygon> <polygon

    fill="#ad3429" points="131.014,184.747 63.991,52.276 39.937,99.813 82.908,184.747"></polygon> <polygon fill="#f2723d" points="216.984,14.856 168.882,14.856 82.927,184.747 131.029,184.747"></polygon> <polygon fill="#f2723d" points="169.039,184.747 217.14,184.747 260.045,99.945 235.993,52.414"></polygon> <polygon fill="#f2723d" points="131.014,14.856 82.908,14.856 39.937,99.784 63.991,147.319"></polygon> </g> </svg>
  5. Iconfonts - the bad • Very hard to align as

    they depend on pseudo-elements (usually ::before), and things like line-height, vertical-align, letter-spacing, word-spacing and kerning.
  6. Conclusion • Icon font if you have limited number and

    low support requirements • svg for more versatility and large icon set