SlideShare a Scribd company logo
1 of 98
Download to read offline
SVG For Web Designers and
Developers
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 1
Hello! ( ◠‿◠ )
— Last name is pronounced Swaïdaan
— Front-End Developer
— Author, Codrops CSS Reference
— Co-Author, Smashing Book 5
— SVG articles: http://sarasoueidan.com/articles
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 2
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 3
Need to support older browsers? There’s a whole bunch
of ways you can do that; and tools to automate the
process for you.
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 4
When to SVG?
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 5
— Raster images are the preferred format when creating
or working with continuous-tone images such as
photographs.
— SVG is the preferred format for images like user
interface controls, logos, icons and vector-based
illustrations.
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 6
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 7
Lighting effects and shadows increase SVG file size to
~300KB.
Optimizing it and reducing effects slashes file size
down to ~40KB.
PNG version currently served is 5.9KB.
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 8
SVG can do more than display images.
— Icon Systems
— Ad banners
— Infographics
— Data visualizations
— Animated illustrations
— Filter effects (on SVG as well as HTML elements, including
text)
— Simple UI shapes and arbitrarily-shaped UI components
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 9
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 10
CSS triangle:
.arrow::after {
content: '';
position: absolute;
width: 0;
height: 0;
width: 0;
height: 0;
border-top: 30px solid transparent;
border-left: 100px solid red;
border-bottom: 30px solid transparent;
z-index: 1;
right: -30px;
top: 50%;
margin-top: -30px;
}
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 11
Custom @-rule (as it appears in PostCSS):
.arrow {
@svg {
polygon {
fill: green;
points: 50,100 0,0 0,100;
}
}
}
Source: https://github.com/jonathantneal/postcss-write-svg
Sass Mixin: https://github.com/davidkpiano/sass-svg
CSS Spec: Coming Soon!
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 12
The Process
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 13
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 14
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 15
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 16
Knowledge gap
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 17
Designers need to know a little bit about code and
developers need to know a little bit about the design
process in order to suggest alternatives to avoided
approcahes. They can help each other fill that
knowledge gap.
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 18
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 19
Design
Creating the SVG (e.g. in a graphics editor)
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 20
Development
Embedding, Spriting, Scripting, Animating
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 21
Export
Optimization
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 22
Design
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 23
1) Convert text to outlines.. or don’t.
— Outlined text is not selectable/searchable/accessible
— Outlined text will preserve the font face you’re using
w/o needing a web font (good for: logos, lettering)
— Outlining can significantly increase file size
depending on font styles
— Outlined text is made up of paths, so might not be as
controllable or animatable as individual characters
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 24
2) Create simple shapes using simple shape elements
instead of <path>s.
— Simple shapes are easier to maintain and edit
manually
— Simple shapes are easier to animate (attribute
values)
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 25
<circle fill="#FFFFFF"
stroke="#000"
cx="28.1"
cy="28.1"
r="27.6"/>
Versus
<path fill="#FFFFFF"
stroke="#000"
d="M55.7,28.1
c0,15.2-12.4,27.6-27.6,27.6
S0.5,43.3,0.5,28.1
S12.9,0.5,28.1,0.5
S55.7,12.9,55.7,28.1z"/>
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 26
3.a) Simplify Paths
Each point is represented as a
pair of coordinates in the
<path> data.
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 27
3.b) Simplify Paths
Use Ai’s Simplify algorithm or
use the Warp tool.
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 28
4) Combine Paths Where Possible
... but only if you don't want to animate the individual
paths separately.
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 29
5) Fit artboard to drawing.
This allows you to crop the SVG
and thus get rid of any extra
white space around your
drawing.
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 30
6) Use Good Grouping, Layering and Naming Conventions
— The layer and group names you use in Illustrator will
be translated to IDs in the SVG code.
— Makes scripting, styling and editing SVG code easier.
— Best for automated workflows that use file names in
SVG generation.
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 31
7) Create filters Using the SVG
Filters available in Ai, not the
Photoshop Effects
Photoshop effects will be
exported as bitmaps, not
converted into SVG filters.
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 32
Photoshop can natively export SVG.
1. Select the layers you want to export.
2. Open the “File > Extract Assets” window.
3. Select layers and define in which format you want to
export them one by one. (You have the choice between
JPEG, PNG and SVG.)
http://creativedroplets.com/generate-svg-with-photoshop-cc-beta/
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 33
8) Export
File → Save As
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 34
Export multiple SVG files using multiple artboards if/
when needed.
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 35
One or Multiple Artboards?
That depends on the spriting technique you intend to
use...
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 36
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 37
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 38
Exporting SVG for the Web with
Illustrator:
http://goo.gl/c0Ri4k
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 39
Always keep the width and height attributes on the
<svg>.
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 40
Communication = !
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 41
Optimize
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 42
Optimization Tools:
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 43
http://sarasoueidan.com/blog/svgo-tools/
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 44
You may not always need or want to optimize...
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 45
Some editors offer more
optimization options that yield
cleaner code.
Inkscape is a great example of
that.
Ai will be getting better.
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 46
Remember: optimization (esp. using standalone tools)
can and will change the document structure, thus
affecting any animation/scripting.
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 47
Develop
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 48
Spriting Technique #1
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 49
Multiple SVG files (e.g. icons) are combined into one SVG
file using <symbol>s
<svg style="display: none;">
<symbol id="icon-twitter" viewBox="0 0 35 35">
<!-- Twitter icon markup -->
</symbol>
<symbol id="icon-github" viewBox="0 0 35 35">
<!-- Github icon markup -->
</symbol>
<!-- more icons here... -->
</svg>
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 50
Accessible icons
<svg style="display: none;">
<symbol id="icon-twitter" viewBox="0 0 35 35"
role="img" aria-labelledby="title description">
<title>Twitter</title>
<description>...</description>
<!-- Twitter icon markup -->
</symbol>
<symbol id="icon-github" viewBox="0 0 35 35"
role="img" aria-labelledby="title description">
<title>Github</title>
<description>...</description>
<!-- Github icon markup -->
</symbol>
<!-- more icons here... -->
</svg>
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 51
Display the icon(s) anywhere in the page:
<svg class="icon-twitter">
<use xlink:href="#icon-twitter"></use>
</svg>
or
<svg class="icon-twitter">
<use xlink:href="icons.svg#icon-twitter"></use>
</svg>
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 52
What about styling <use>d
images?
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 53
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 54
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 55
<use id="robot-1" xlink:href="#robot" ... />
<use id="robot-2" xlink:href="#robot" ... />
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 56
You can define the colors that make up your theme in
the style sheet:
#robot-1 {
--primary-color: #0099CC;
--secondary-color: #FFDF34;
--tertiary-color: #333;
}
#robot-2 {
--primary-color: #E52A39;
--secondary-color: #11EBD8;
--tertiary-color: #000;
}
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 57
and then use those variables in the SVG:
<svg style="display: none">
<symbol id="robot" viewBox="0 0 340 536">
<path d="..." fill="#fff" />
<path d="..." fill="#D1312C" />
<path d="..." fill="#1E8F90" style="fill: var(--primary-color, #1E8F90)" />
<path d="..." fill="#1E8F90" style="fill: var(--primary-color, #1E8F90)" />
<path d="..." fill="#fff" />
<path d="..." fill="#6A4933" style="fill: var(--tertiary-color, #6A4933)" />
<path d="..." fill="#1E8F90" style="fill: var(--primary-color, #1E8F90)" />
<path d="..." fill="#6A4933" style="fill: var(--tertiary-color, #6A4933)" />
<path d="..." fill="#fff" />
<path d="..." fill="#6A4933" style="fill: var(--tertiary-color, #6A4933)" />
<path d="..." fill="#F2B42B" style="fill: var(--secondary-color, #F2B42B)" />
<path d="..." fill="#fff" />
<!-- rest of the shapes -->
</symbol>
</svg>
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 58
Read all about styling the contents of use at: http://
tympanus.net/codrops/2015/07/16/styling-svg-use-
content-css/
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 59
“SVG Parameters are a way to set CSS custom
properties on an "external" SVG image, by passing them
through a special fragment scheme on the URL. This
gives a limited, but powerful, subset of the
customizability that "inline" SVG images have to
"external" SVG images.”
Source: https://tabatkins.github.io/specs/svg-params/
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 60
<img src="http://example.com/image.svg#param(--text-color%20blue)" alt=".." />`
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 61
Spriting Technique #2
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 62
Using Fragment Identifiers
— A visual approach to spriting SVG (Similar to spriting
using a PNG)
— Uses one sprite that contains all icons
— Uses the position and bounding box an icon inside
the sprite
— to create a "view" for that icon
— You display each icon by referencing its view
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 63
To create a view, get the position and dimensions of the
icon from the gaphics editor
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 64
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 65
<img src='uiIcons.svg#svgView(viewBox(64, 0, 32, 32))' alt="..."/>
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 66
<view id='instagram-icon' viewBox='64 0 32 32' />
<img src='sprite.svg#instagram-icon' alt="Instagram icon" />
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 67
Important: Remember to specify width and height for the
<img> referencing the sprite views.
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 68
Spriting Technique #3
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 69
Icons as background images in CSS
— The closest you can get to icon fonts, using SVG
— Support back to IE6
— Same animation capabilities as icon fonts, plus the
advantages of SVG.
— There are tools to automate and speed up the
spriting process.
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 70
Grunticon and/or Grumpicon for automation
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 71
SVG is embedded as data URI in CSS:
.twitter-icon{
background-image: url('data:image/svg+xml;…');
background-repeat: no-repeat;
background-position: 50% 50%;
height: 2em;
width: 2em;
/* etc. */
}
<span class="twitter-icon"></span>
A script takes care of loading the appropriate version for the different browsers.
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 72
Overview of all spriting techniques: https://24ways.org/
2014/an-overview-of-svg-sprite-creation-techniques/
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 73
WHY would I want to use SVG over icon fonts?
— Infinitely scalable & look crisp on all resolutions
— Styleable via CSS (multi-colors)
— Easier size control
— Interactive and animatable using CSS, SMIL and/or JavaScript
— Semantic markup
— Fully accessible (incl. text contained in an icon)
— Many tools available to make creation, interaction, embedding and
spriting easier
— Different embedding and fallback techniques
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 74
Just moved @selz from icon
fonts (woff2) over to SVG sprites.
Saved 7.2% in CSS and 51.6%
woff2 to SVG.
— Sam Potts
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 75
We don't download fonts; icons
are what svg is for.
— Bruce 'Captain Wonderful' of Opera (a.k.a Bruce
Lawson)
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 76
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 77
If you still need convincing, read this: https://css-
tricks.com/icon-fonts-vs-svg/
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 78
Want to make a switch? This tool might help you:
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 79
#nomoreexcuses
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 80
Animating SVG: SMIL, CSS
or JavaScript?
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 81
— Don’t use SMIL.
— Use CSS only for simple animations.
— Use JavaScript for complex animations.
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 82
Popular SVG JavaScript animation libraries:
1. GreenSock Animation Platform (GSAP)
2. Snap.svg (“The jQuery of SVG”)
3. Velocity.js
4. D3.js
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 83
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 84
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 85
Read more here: http://greensock.com/svg-tips
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 86
Which Embedding
Technique Should You
Choose?
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 87
1. <img src="mySVG.svg" alt="..."/>
2. background-image: url(path/to/mySVG.svg);
3. <object type="image/svg+xml" data="mySVG.svg">
<!-- fallback here -->
</object>
4. <iframe src="mySVG.svg">
<!-- fallback here -->
</iframe>
5. <svg xmlns="http://www.w3.org/2000/svg" …>
<!-- svg content -->
</svg>
6. <picture>
<source type="image/svg+xml" srcset="path/to/image.svg">
<img src="path/to/fallback.png" alt="Image description">
</picture>
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 88
Filter your options down; set priorities (and compromises when needed).
— Is the SVG animated?
— Is it interactive?
— What kind of animation? (Does it require JS?)
— What browser support do I need (for the animation)?
— What kind of content and fallback do you need? (e.g.
infographics)
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 89
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 90
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 91
Why I love <object>
— Enables modularity of content without sacrificing
modularity and reusability of styles/animations
— Scriptable, animatable, interactive
— Cacheable resource
— Default fallback mechanism
— Fallback can be image or text, and even both.
— All the benefits of using SVG: accessible content,
searchable and selectable text, interactive shapes, etc.
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 92
Practical Example #1: Ad Banners
— The banner content including scripts and animations
are "encapsulated" and easily reusable
— Separation of concerns
— Plug <object> in and play, while scripts and
interactions are handled and maintained using
JavaScript.
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 93
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 94
Recommended reading: http://codepen.io/chrisgannon/
blog/my-first-svg-banner-ad
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 95
Practical Example #2: Infographics
— Infographic is animated and can
be interactive
— Best kind of fallback is text
content of the data presented in
the graphic, goes between
opening and closing <object>
tags.
Image source: http://provatahealth.com
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 96
Credits
— Geometric background designed by Freepik.
— GSAP Screenshots by GreenSock.
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 97
Thank you!
SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 98

More Related Content

What's hot

Network graphs in tableau
Network graphs in tableauNetwork graphs in tableau
Network graphs in tableauGodfrey Nolan
 
SVG - Scalable Vector Graphics
SVG - Scalable Vector GraphicsSVG - Scalable Vector Graphics
SVG - Scalable Vector GraphicsShweta Sadawarte
 
(12/15) Tεχνολογία των Εκτυπώσεων ΚΕΦ.12 - Σαράφη Αντιγόνη
(12/15) Tεχνολογία των Εκτυπώσεων ΚΕΦ.12 - Σαράφη Αντιγόνη(12/15) Tεχνολογία των Εκτυπώσεων ΚΕΦ.12 - Σαράφη Αντιγόνη
(12/15) Tεχνολογία των Εκτυπώσεων ΚΕΦ.12 - Σαράφη ΑντιγόνηAntigoni Sarafi
 
Systèmes de Gestion de Contenu (SGC)
Systèmes de Gestion de Contenu (SGC)Systèmes de Gestion de Contenu (SGC)
Systèmes de Gestion de Contenu (SGC)Laurent Moccozet
 
Atelier2 Odoo: Gestion des Ressources Humaines (installation, employés, contr...
Atelier2 Odoo: Gestion des Ressources Humaines (installation, employés, contr...Atelier2 Odoo: Gestion des Ressources Humaines (installation, employés, contr...
Atelier2 Odoo: Gestion des Ressources Humaines (installation, employés, contr...Abdelouahed Abdou
 

What's hot (9)

Network graphs in tableau
Network graphs in tableauNetwork graphs in tableau
Network graphs in tableau
 
SVG - Scalable Vector Graphics
SVG - Scalable Vector GraphicsSVG - Scalable Vector Graphics
SVG - Scalable Vector Graphics
 
3 d viewing
3 d viewing3 d viewing
3 d viewing
 
(12/15) Tεχνολογία των Εκτυπώσεων ΚΕΦ.12 - Σαράφη Αντιγόνη
(12/15) Tεχνολογία των Εκτυπώσεων ΚΕΦ.12 - Σαράφη Αντιγόνη(12/15) Tεχνολογία των Εκτυπώσεων ΚΕΦ.12 - Σαράφη Αντιγόνη
(12/15) Tεχνολογία των Εκτυπώσεων ΚΕΦ.12 - Σαράφη Αντιγόνη
 
Systèmes de Gestion de Contenu (SGC)
Systèmes de Gestion de Contenu (SGC)Systèmes de Gestion de Contenu (SGC)
Systèmes de Gestion de Contenu (SGC)
 
Bootstrap [part 1]
Bootstrap [part 1]Bootstrap [part 1]
Bootstrap [part 1]
 
Atelier2 Odoo: Gestion des Ressources Humaines (installation, employés, contr...
Atelier2 Odoo: Gestion des Ressources Humaines (installation, employés, contr...Atelier2 Odoo: Gestion des Ressources Humaines (installation, employés, contr...
Atelier2 Odoo: Gestion des Ressources Humaines (installation, employés, contr...
 
Review blender
Review blenderReview blender
Review blender
 
Creating Infographics with Canva
Creating Infographics with CanvaCreating Infographics with Canva
Creating Infographics with Canva
 

Viewers also liked

HTML5 and SVG
HTML5 and SVGHTML5 and SVG
HTML5 and SVGyarcub
 
Html5, css3, canvas, svg and webgl
Html5, css3, canvas, svg and webglHtml5, css3, canvas, svg and webgl
Html5, css3, canvas, svg and webglKilian Valkhof
 
Html5 canvas & svg 2012 dcc
Html5 canvas & svg 2012 dccHtml5 canvas & svg 2012 dcc
Html5 canvas & svg 2012 dcctakwhan kim
 
Responsive Web Design [rebuild as design]
Responsive Web Design [rebuild as design]Responsive Web Design [rebuild as design]
Responsive Web Design [rebuild as design]Benny Chak
 
面向未来的友好设计
面向未来的友好设计面向未来的友好设计
面向未来的友好设计Benny Chak
 
Dive Into SVG
Dive Into SVGDive Into SVG
Dive Into SVGyomotsu
 
제 5회 DGMIT R&D 컨퍼런스: HTML Graphics AP
 제 5회 DGMIT R&D 컨퍼런스: HTML Graphics AP 제 5회 DGMIT R&D 컨퍼런스: HTML Graphics AP
제 5회 DGMIT R&D 컨퍼런스: HTML Graphics APdgmit2009
 
Dive into HTML5: SVG and Canvas
Dive into HTML5: SVG and CanvasDive into HTML5: SVG and Canvas
Dive into HTML5: SVG and CanvasDoris Chen
 
Introduction to HTML5 Canvas
Introduction to HTML5 CanvasIntroduction to HTML5 Canvas
Introduction to HTML5 CanvasMindy McAdams
 
UX 101: A quick & dirty introduction to user experience strategy & design
UX 101: A quick & dirty introduction to user experience strategy & designUX 101: A quick & dirty introduction to user experience strategy & design
UX 101: A quick & dirty introduction to user experience strategy & designMorgan McKeagney
 

Viewers also liked (20)

Learn svg
Learn svgLearn svg
Learn svg
 
HTML5 and SVG
HTML5 and SVGHTML5 and SVG
HTML5 and SVG
 
Html5, css3, canvas, svg and webgl
Html5, css3, canvas, svg and webglHtml5, css3, canvas, svg and webgl
Html5, css3, canvas, svg and webgl
 
Html5 canvas & svg 2012 dcc
Html5 canvas & svg 2012 dccHtml5 canvas & svg 2012 dcc
Html5 canvas & svg 2012 dcc
 
HTML5 & SVG in Cartography - Workshop
HTML5 & SVG in Cartography - WorkshopHTML5 & SVG in Cartography - Workshop
HTML5 & SVG in Cartography - Workshop
 
Responsive Web Design [rebuild as design]
Responsive Web Design [rebuild as design]Responsive Web Design [rebuild as design]
Responsive Web Design [rebuild as design]
 
面向未来的友好设计
面向未来的友好设计面向未来的友好设计
面向未来的友好设计
 
Next generation Graphics: SVG
Next generation Graphics: SVGNext generation Graphics: SVG
Next generation Graphics: SVG
 
Dive Into SVG
Dive Into SVGDive Into SVG
Dive Into SVG
 
제 5회 DGMIT R&D 컨퍼런스: HTML Graphics AP
 제 5회 DGMIT R&D 컨퍼런스: HTML Graphics AP 제 5회 DGMIT R&D 컨퍼런스: HTML Graphics AP
제 5회 DGMIT R&D 컨퍼런스: HTML Graphics AP
 
Svg
SvgSvg
Svg
 
Dive into HTML5: SVG and Canvas
Dive into HTML5: SVG and CanvasDive into HTML5: SVG and Canvas
Dive into HTML5: SVG and Canvas
 
Canvas - HTML 5
Canvas - HTML 5Canvas - HTML 5
Canvas - HTML 5
 
HTML 5 Canvas & SVG
HTML 5 Canvas & SVGHTML 5 Canvas & SVG
HTML 5 Canvas & SVG
 
Smart Mirror for Digital Signage
Smart Mirror for Digital SignageSmart Mirror for Digital Signage
Smart Mirror for Digital Signage
 
HTML5 Canvas
HTML5 CanvasHTML5 Canvas
HTML5 Canvas
 
Introduction to HTML5 Canvas
Introduction to HTML5 CanvasIntroduction to HTML5 Canvas
Introduction to HTML5 Canvas
 
Bootstrap ppt
Bootstrap pptBootstrap ppt
Bootstrap ppt
 
UI/UX Design
UI/UX DesignUI/UX Design
UI/UX Design
 
UX 101: A quick & dirty introduction to user experience strategy & design
UX 101: A quick & dirty introduction to user experience strategy & designUX 101: A quick & dirty introduction to user experience strategy & design
UX 101: A quick & dirty introduction to user experience strategy & design
 

Similar to SVG For Web Designers (and Developers)

Simply Responsive CSS3
Simply Responsive CSS3Simply Responsive CSS3
Simply Responsive CSS3Denise Jacobs
 
CSS3: Ripe and Ready
CSS3: Ripe and ReadyCSS3: Ripe and Ready
CSS3: Ripe and ReadyDenise Jacobs
 
CSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to RespondCSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to RespondDenise Jacobs
 
Vector Graphics on the Web: SVG, Canvas, CSS3
Vector Graphics on the Web: SVG, Canvas, CSS3Vector Graphics on the Web: SVG, Canvas, CSS3
Vector Graphics on the Web: SVG, Canvas, CSS3Pascal Rettig
 
Accessibility Hacks version 2
Accessibility Hacks version 2Accessibility Hacks version 2
Accessibility Hacks version 2Graham Armfield
 
Accessibility Hacks Version 2
Accessibility Hacks Version 2Accessibility Hacks Version 2
Accessibility Hacks Version 2Graham Armfield
 
Accessibility Hacks Wordcamp Manchester October 2018
Accessibility Hacks Wordcamp Manchester October 2018Accessibility Hacks Wordcamp Manchester October 2018
Accessibility Hacks Wordcamp Manchester October 2018Graham Armfield
 
CSS Workflow. Pre & Post
CSS Workflow. Pre & PostCSS Workflow. Pre & Post
CSS Workflow. Pre & PostAnton Dosov
 
Thats Not Flash?
Thats Not Flash?Thats Not Flash?
Thats Not Flash?Mike Wilcox
 
SVG Certification
SVG CertificationSVG Certification
SVG CertificationVskills
 
Web Design Trends 2010 - What Is CSS3 All About?
Web Design Trends 2010 - What Is CSS3 All About?Web Design Trends 2010 - What Is CSS3 All About?
Web Design Trends 2010 - What Is CSS3 All About?Alexandra Lo Cascio
 
Html5 Canvas Detail
Html5 Canvas DetailHtml5 Canvas Detail
Html5 Canvas DetailNisa Soomro
 
CSS3: Are you experienced?
CSS3: Are you experienced?CSS3: Are you experienced?
CSS3: Are you experienced?Denise Jacobs
 
2009_09_11_Grid960
2009_09_11_Grid9602009_09_11_Grid960
2009_09_11_Grid960LightSpeed
 

Similar to SVG For Web Designers (and Developers) (20)

Intro to CSS3
Intro to CSS3Intro to CSS3
Intro to CSS3
 
Simply Responsive CSS3
Simply Responsive CSS3Simply Responsive CSS3
Simply Responsive CSS3
 
CSS3: Ripe and Ready
CSS3: Ripe and ReadyCSS3: Ripe and Ready
CSS3: Ripe and Ready
 
CSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to RespondCSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to Respond
 
SVG 101
SVG 101SVG 101
SVG 101
 
Before Going Vector
Before Going VectorBefore Going Vector
Before Going Vector
 
SVG introduction
SVG   introductionSVG   introduction
SVG introduction
 
Vector Graphics on the Web: SVG, Canvas, CSS3
Vector Graphics on the Web: SVG, Canvas, CSS3Vector Graphics on the Web: SVG, Canvas, CSS3
Vector Graphics on the Web: SVG, Canvas, CSS3
 
Accessibility Hacks version 2
Accessibility Hacks version 2Accessibility Hacks version 2
Accessibility Hacks version 2
 
Accessibility Hacks Version 2
Accessibility Hacks Version 2Accessibility Hacks Version 2
Accessibility Hacks Version 2
 
Accessibility Hacks Wordcamp Manchester October 2018
Accessibility Hacks Wordcamp Manchester October 2018Accessibility Hacks Wordcamp Manchester October 2018
Accessibility Hacks Wordcamp Manchester October 2018
 
CSS Workflow. Pre & Post
CSS Workflow. Pre & PostCSS Workflow. Pre & Post
CSS Workflow. Pre & Post
 
Thats Not Flash?
Thats Not Flash?Thats Not Flash?
Thats Not Flash?
 
SVG Certification
SVG CertificationSVG Certification
SVG Certification
 
Css3
Css3Css3
Css3
 
Html 5 svg
Html 5 svgHtml 5 svg
Html 5 svg
 
Web Design Trends 2010 - What Is CSS3 All About?
Web Design Trends 2010 - What Is CSS3 All About?Web Design Trends 2010 - What Is CSS3 All About?
Web Design Trends 2010 - What Is CSS3 All About?
 
Html5 Canvas Detail
Html5 Canvas DetailHtml5 Canvas Detail
Html5 Canvas Detail
 
CSS3: Are you experienced?
CSS3: Are you experienced?CSS3: Are you experienced?
CSS3: Are you experienced?
 
2009_09_11_Grid960
2009_09_11_Grid9602009_09_11_Grid960
2009_09_11_Grid960
 

Recently uploaded

Russian Call Girls in Kolkata Samaira 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Samaira 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
Networking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGNetworking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGAPNIC
 
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Sheetaleventcompany
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxellan12
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024APNIC
 
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts servicesonalikaur4
 
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls KolkataVIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Russian Call girls in Dubai +971563133746 Dubai Call girls
Russian  Call girls in Dubai +971563133746 Dubai  Call girlsRussian  Call girls in Dubai +971563133746 Dubai  Call girls
Russian Call girls in Dubai +971563133746 Dubai Call girlsstephieert
 
Radiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girlsRadiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girlsstephieert
 
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Roomishabajaj13
 
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girlsstephieert
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...APNIC
 
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya Shirtrahman018755
 
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...aditipandeya
 
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$kojalkojal131
 

Recently uploaded (20)

Russian Call Girls in Kolkata Samaira 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Samaira 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
Networking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGNetworking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOG
 
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
 
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
 
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls KolkataVIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
 
Russian Call girls in Dubai +971563133746 Dubai Call girls
Russian  Call girls in Dubai +971563133746 Dubai  Call girlsRussian  Call girls in Dubai +971563133746 Dubai  Call girls
Russian Call girls in Dubai +971563133746 Dubai Call girls
 
Radiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girlsRadiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girls
 
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
 
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls
 
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
 
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
 
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
 
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
 

SVG For Web Designers (and Developers)

  • 1. SVG For Web Designers and Developers SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 1
  • 2. Hello! ( ◠‿◠ ) — Last name is pronounced Swaïdaan — Front-End Developer — Author, Codrops CSS Reference — Co-Author, Smashing Book 5 — SVG articles: http://sarasoueidan.com/articles SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 2
  • 3. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 3
  • 4. Need to support older browsers? There’s a whole bunch of ways you can do that; and tools to automate the process for you. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 4
  • 5. When to SVG? SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 5
  • 6. — Raster images are the preferred format when creating or working with continuous-tone images such as photographs. — SVG is the preferred format for images like user interface controls, logos, icons and vector-based illustrations. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 6
  • 7. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 7
  • 8. Lighting effects and shadows increase SVG file size to ~300KB. Optimizing it and reducing effects slashes file size down to ~40KB. PNG version currently served is 5.9KB. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 8
  • 9. SVG can do more than display images. — Icon Systems — Ad banners — Infographics — Data visualizations — Animated illustrations — Filter effects (on SVG as well as HTML elements, including text) — Simple UI shapes and arbitrarily-shaped UI components SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 9
  • 10. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 10
  • 11. CSS triangle: .arrow::after { content: ''; position: absolute; width: 0; height: 0; width: 0; height: 0; border-top: 30px solid transparent; border-left: 100px solid red; border-bottom: 30px solid transparent; z-index: 1; right: -30px; top: 50%; margin-top: -30px; } SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 11
  • 12. Custom @-rule (as it appears in PostCSS): .arrow { @svg { polygon { fill: green; points: 50,100 0,0 0,100; } } } Source: https://github.com/jonathantneal/postcss-write-svg Sass Mixin: https://github.com/davidkpiano/sass-svg CSS Spec: Coming Soon! SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 12
  • 13. The Process SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 13
  • 14. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 14
  • 15. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 15
  • 16. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 16
  • 17. Knowledge gap SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 17
  • 18. Designers need to know a little bit about code and developers need to know a little bit about the design process in order to suggest alternatives to avoided approcahes. They can help each other fill that knowledge gap. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 18
  • 19. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 19
  • 20. Design Creating the SVG (e.g. in a graphics editor) SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 20
  • 21. Development Embedding, Spriting, Scripting, Animating SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 21
  • 22. Export Optimization SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 22
  • 23. Design SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 23
  • 24. 1) Convert text to outlines.. or don’t. — Outlined text is not selectable/searchable/accessible — Outlined text will preserve the font face you’re using w/o needing a web font (good for: logos, lettering) — Outlining can significantly increase file size depending on font styles — Outlined text is made up of paths, so might not be as controllable or animatable as individual characters SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 24
  • 25. 2) Create simple shapes using simple shape elements instead of <path>s. — Simple shapes are easier to maintain and edit manually — Simple shapes are easier to animate (attribute values) SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 25
  • 27. 3.a) Simplify Paths Each point is represented as a pair of coordinates in the <path> data. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 27
  • 28. 3.b) Simplify Paths Use Ai’s Simplify algorithm or use the Warp tool. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 28
  • 29. 4) Combine Paths Where Possible ... but only if you don't want to animate the individual paths separately. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 29
  • 30. 5) Fit artboard to drawing. This allows you to crop the SVG and thus get rid of any extra white space around your drawing. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 30
  • 31. 6) Use Good Grouping, Layering and Naming Conventions — The layer and group names you use in Illustrator will be translated to IDs in the SVG code. — Makes scripting, styling and editing SVG code easier. — Best for automated workflows that use file names in SVG generation. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 31
  • 32. 7) Create filters Using the SVG Filters available in Ai, not the Photoshop Effects Photoshop effects will be exported as bitmaps, not converted into SVG filters. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 32
  • 33. Photoshop can natively export SVG. 1. Select the layers you want to export. 2. Open the “File > Extract Assets” window. 3. Select layers and define in which format you want to export them one by one. (You have the choice between JPEG, PNG and SVG.) http://creativedroplets.com/generate-svg-with-photoshop-cc-beta/ SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 33
  • 34. 8) Export File → Save As SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 34
  • 35. Export multiple SVG files using multiple artboards if/ when needed. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 35
  • 36. One or Multiple Artboards? That depends on the spriting technique you intend to use... SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 36
  • 37. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 37
  • 38. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 38
  • 39. Exporting SVG for the Web with Illustrator: http://goo.gl/c0Ri4k SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 39
  • 40. Always keep the width and height attributes on the <svg>. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 40
  • 41. Communication = ! SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 41
  • 42. Optimize SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 42
  • 43. Optimization Tools: SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 43
  • 44. http://sarasoueidan.com/blog/svgo-tools/ SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 44
  • 45. You may not always need or want to optimize... SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 45
  • 46. Some editors offer more optimization options that yield cleaner code. Inkscape is a great example of that. Ai will be getting better. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 46
  • 47. Remember: optimization (esp. using standalone tools) can and will change the document structure, thus affecting any animation/scripting. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 47
  • 48. Develop SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 48
  • 49. Spriting Technique #1 SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 49
  • 50. Multiple SVG files (e.g. icons) are combined into one SVG file using <symbol>s <svg style="display: none;"> <symbol id="icon-twitter" viewBox="0 0 35 35"> <!-- Twitter icon markup --> </symbol> <symbol id="icon-github" viewBox="0 0 35 35"> <!-- Github icon markup --> </symbol> <!-- more icons here... --> </svg> SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 50
  • 51. Accessible icons <svg style="display: none;"> <symbol id="icon-twitter" viewBox="0 0 35 35" role="img" aria-labelledby="title description"> <title>Twitter</title> <description>...</description> <!-- Twitter icon markup --> </symbol> <symbol id="icon-github" viewBox="0 0 35 35" role="img" aria-labelledby="title description"> <title>Github</title> <description>...</description> <!-- Github icon markup --> </symbol> <!-- more icons here... --> </svg> SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 51
  • 52. Display the icon(s) anywhere in the page: <svg class="icon-twitter"> <use xlink:href="#icon-twitter"></use> </svg> or <svg class="icon-twitter"> <use xlink:href="icons.svg#icon-twitter"></use> </svg> SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 52
  • 53. What about styling <use>d images? SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 53
  • 54. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 54
  • 55. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 55
  • 56. <use id="robot-1" xlink:href="#robot" ... /> <use id="robot-2" xlink:href="#robot" ... /> SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 56
  • 57. You can define the colors that make up your theme in the style sheet: #robot-1 { --primary-color: #0099CC; --secondary-color: #FFDF34; --tertiary-color: #333; } #robot-2 { --primary-color: #E52A39; --secondary-color: #11EBD8; --tertiary-color: #000; } SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 57
  • 58. and then use those variables in the SVG: <svg style="display: none"> <symbol id="robot" viewBox="0 0 340 536"> <path d="..." fill="#fff" /> <path d="..." fill="#D1312C" /> <path d="..." fill="#1E8F90" style="fill: var(--primary-color, #1E8F90)" /> <path d="..." fill="#1E8F90" style="fill: var(--primary-color, #1E8F90)" /> <path d="..." fill="#fff" /> <path d="..." fill="#6A4933" style="fill: var(--tertiary-color, #6A4933)" /> <path d="..." fill="#1E8F90" style="fill: var(--primary-color, #1E8F90)" /> <path d="..." fill="#6A4933" style="fill: var(--tertiary-color, #6A4933)" /> <path d="..." fill="#fff" /> <path d="..." fill="#6A4933" style="fill: var(--tertiary-color, #6A4933)" /> <path d="..." fill="#F2B42B" style="fill: var(--secondary-color, #F2B42B)" /> <path d="..." fill="#fff" /> <!-- rest of the shapes --> </symbol> </svg> SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 58
  • 59. Read all about styling the contents of use at: http:// tympanus.net/codrops/2015/07/16/styling-svg-use- content-css/ SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 59
  • 60. “SVG Parameters are a way to set CSS custom properties on an "external" SVG image, by passing them through a special fragment scheme on the URL. This gives a limited, but powerful, subset of the customizability that "inline" SVG images have to "external" SVG images.” Source: https://tabatkins.github.io/specs/svg-params/ SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 60
  • 61. <img src="http://example.com/image.svg#param(--text-color%20blue)" alt=".." />` SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 61
  • 62. Spriting Technique #2 SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 62
  • 63. Using Fragment Identifiers — A visual approach to spriting SVG (Similar to spriting using a PNG) — Uses one sprite that contains all icons — Uses the position and bounding box an icon inside the sprite — to create a "view" for that icon — You display each icon by referencing its view SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 63
  • 64. To create a view, get the position and dimensions of the icon from the gaphics editor SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 64
  • 65. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 65
  • 66. <img src='uiIcons.svg#svgView(viewBox(64, 0, 32, 32))' alt="..."/> SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 66
  • 67. <view id='instagram-icon' viewBox='64 0 32 32' /> <img src='sprite.svg#instagram-icon' alt="Instagram icon" /> SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 67
  • 68. Important: Remember to specify width and height for the <img> referencing the sprite views. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 68
  • 69. Spriting Technique #3 SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 69
  • 70. Icons as background images in CSS — The closest you can get to icon fonts, using SVG — Support back to IE6 — Same animation capabilities as icon fonts, plus the advantages of SVG. — There are tools to automate and speed up the spriting process. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 70
  • 71. Grunticon and/or Grumpicon for automation SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 71
  • 72. SVG is embedded as data URI in CSS: .twitter-icon{ background-image: url('data:image/svg+xml;…'); background-repeat: no-repeat; background-position: 50% 50%; height: 2em; width: 2em; /* etc. */ } <span class="twitter-icon"></span> A script takes care of loading the appropriate version for the different browsers. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 72
  • 73. Overview of all spriting techniques: https://24ways.org/ 2014/an-overview-of-svg-sprite-creation-techniques/ SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 73
  • 74. WHY would I want to use SVG over icon fonts? — Infinitely scalable & look crisp on all resolutions — Styleable via CSS (multi-colors) — Easier size control — Interactive and animatable using CSS, SMIL and/or JavaScript — Semantic markup — Fully accessible (incl. text contained in an icon) — Many tools available to make creation, interaction, embedding and spriting easier — Different embedding and fallback techniques SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 74
  • 75. Just moved @selz from icon fonts (woff2) over to SVG sprites. Saved 7.2% in CSS and 51.6% woff2 to SVG. — Sam Potts SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 75
  • 76. We don't download fonts; icons are what svg is for. — Bruce 'Captain Wonderful' of Opera (a.k.a Bruce Lawson) SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 76
  • 77. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 77
  • 78. If you still need convincing, read this: https://css- tricks.com/icon-fonts-vs-svg/ SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 78
  • 79. Want to make a switch? This tool might help you: SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 79
  • 80. #nomoreexcuses SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 80
  • 81. Animating SVG: SMIL, CSS or JavaScript? SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 81
  • 82. — Don’t use SMIL. — Use CSS only for simple animations. — Use JavaScript for complex animations. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 82
  • 83. Popular SVG JavaScript animation libraries: 1. GreenSock Animation Platform (GSAP) 2. Snap.svg (“The jQuery of SVG”) 3. Velocity.js 4. D3.js SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 83
  • 84. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 84
  • 85. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 85
  • 86. Read more here: http://greensock.com/svg-tips SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 86
  • 87. Which Embedding Technique Should You Choose? SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 87
  • 88. 1. <img src="mySVG.svg" alt="..."/> 2. background-image: url(path/to/mySVG.svg); 3. <object type="image/svg+xml" data="mySVG.svg"> <!-- fallback here --> </object> 4. <iframe src="mySVG.svg"> <!-- fallback here --> </iframe> 5. <svg xmlns="http://www.w3.org/2000/svg" …> <!-- svg content --> </svg> 6. <picture> <source type="image/svg+xml" srcset="path/to/image.svg"> <img src="path/to/fallback.png" alt="Image description"> </picture> SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 88
  • 89. Filter your options down; set priorities (and compromises when needed). — Is the SVG animated? — Is it interactive? — What kind of animation? (Does it require JS?) — What browser support do I need (for the animation)? — What kind of content and fallback do you need? (e.g. infographics) SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 89
  • 90. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 90
  • 91. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 91
  • 92. Why I love <object> — Enables modularity of content without sacrificing modularity and reusability of styles/animations — Scriptable, animatable, interactive — Cacheable resource — Default fallback mechanism — Fallback can be image or text, and even both. — All the benefits of using SVG: accessible content, searchable and selectable text, interactive shapes, etc. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 92
  • 93. Practical Example #1: Ad Banners — The banner content including scripts and animations are "encapsulated" and easily reusable — Separation of concerns — Plug <object> in and play, while scripts and interactions are handled and maintained using JavaScript. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 93
  • 94. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 94
  • 95. Recommended reading: http://codepen.io/chrisgannon/ blog/my-first-svg-banner-ad SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 95
  • 96. Practical Example #2: Infographics — Infographic is animated and can be interactive — Best kind of fallback is text content of the data presented in the graphic, goes between opening and closing <object> tags. Image source: http://provatahealth.com SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 96
  • 97. Credits — Geometric background designed by Freepik. — GSAP Screenshots by GreenSock. SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 97
  • 98. Thank you! SVG for Web Designers & Developers | @SaraSoueidan | SaraSoueidan.com 98