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

I Know I Should Use SVGs But I Don't Know How

Colin Lord
September 21, 2017

I Know I Should Use SVGs But I Don't Know How

Most people are using SVGs in their front end code, but according to Advanced Web Ranking.com, only 3% of sites are using them to their full potential. In this talk we will go through the lesser known features of SVGs and how they'll save you time in development.

Colin Lord

September 21, 2017
Tweet

More Decks by Colin Lord

Other Decks in Technology

Transcript

  1. Why are SVGs awesome? • Smaller files (if used properly)

    • HDPI ready • Fully supported in all modern browsers
  2. • Smaller files (if used properly) • HDPI ready •

    Fully supported in all modern browsers Why are SVGs awesome? • Easy to animate • Manipulate with CSS and JavaScript • Perfect for responsive sites
  3. <svg width="0" height="0" style="display: none;”> <symbol id="svg-facebook" viewBox="0 0 50

    50”> </symbol> <symbol id="svg-twitter" viewBox="0 0 50 50”> </symbol> </svg>
  4. <svg width="0" height="0" style="display: none;”> <symbol id="svg-facebook" viewBox="0 0 50

    50”> <title>Facebook</title> <!-- svg code goes here --> </symbol> <symbol id="svg-twitter" viewBox="0 0 50 50”> <title>Twitter</title> <!-- svg code goes here --> </symbol> </svg>
  5. <img> CSS HTML Sprite Smaller file sizes Caching Clean HTML

    Repeating the same SVG Implementation speed Animation Icon sets HDPI & any width/height DOM Manipulation
  6. • Smaller files • Fully supported in all modern browsers

    • Easy to animate • Manipulate with CSS and JavaScript • Always optimized for HDPI screens • Perfect for responsive sites Why are SVGs awesome?