Top Banner
Death to Icon Fonts @ninjanails CodeMotion, May 2016 https://www.flickr.com/photos/minifig/3186925111/
80

Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

Apr 15, 2017

Download

Technology

Codemotion
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

Death to Icon Fonts@ninjanailsCodeMotion, May 2016

https://www.flickr.com/photos/minifig/3186925111/

Page 2: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016
Page 3: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

1 in 10 are Dyslexic

Page 4: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

Flatulent clams

Page 5: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

Flatulent clams

Fraudulent claims

Page 6: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

http://www.cafepress.co.uk/mf/94227980/keep-clam-and-stop-dyslexia_mugs

Page 7: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

https://www.flickr.com/photos/jonathancohen/4084485753/

Page 8: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

Aa Bb Cc Dd Ee Ff Gg Hh Ii Jj Kk Ll Mm Nn Oo Pp Qq Rr Ss Tt Uu Vv Ww Xx Yy Zz

Page 9: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

bp

Page 10: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

bp

Page 11: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

Gill Sans rnm MW dpqb l1IijJ

Verdana rnm MW dpqb l1IijJ

OpenDyslexic rnm MW dpqb l1IijJ

Times rnm MW dpqb l1IijJ

Helvetica rnm MW dpqb l1IijJ

#DZY

Page 12: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016
Page 13: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016
Page 14: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

But all too often I see:

Page 15: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

Let’s pick on old GitHub…

Page 16: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

Let’s pick on old GitHub…

Page 17: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

Let’s pick on old GitHub…#DZY

Page 18: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016
Page 19: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

https://www.flickr.com/photos/3059349393/3801594313/

Some users may be hidden…

Page 20: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

People have different needs!

https://www.flickr.com/photos/oskay/265899766/https://www.flickr.com/photos/oskay/265899766/

Page 21: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

Screen Readers

Page 22: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

Favourite

How would a screen reader read…

Page 23: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

Favourite

“Favourite”

Page 24: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

Favourite

“Black Star Favourite” or “Star Favourite”

Page 25: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

Favourite

“Unpronounceable Favourite”

Page 26: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

http://unicode.johnholtripley.co.uk

Page 27: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

https://www.flickr.com/photos/nouqraz/308342941/

Are we forgetting some people?

Page 28: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

Opera Mini

Page 29: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

“… We don’t download fonts; icons are what SVG is for.”

Bruce Lawson, Opera

https://www.flickr.com/photos/zeldman/14064254462/

Page 30: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

“This doesn’t just benefit Opera Mini users; many people with mild dyslexia have a special system font to aid legibility, which breaks icon fonts.”

Bruce Lawson, Opera

https://dev.opera.com/articles/making-sites-work-opera-mini/

Page 31: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

Opera Mini has 250M+ users

(And then there’s Nokia Xpress, Blackberry 4 & 5, Android 2.1, Windows 7)

Page 32: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

https://www.flickr.com/photos/subharnab/2721507697/

And then there’s you…

Page 33: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

https://goo.gl/EpsOu8

Page 34: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016
Page 35: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016
Page 36: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

https://speakerdeck.com/zachleat/remodeling-at-font-face

Page 37: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016
Page 38: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016
Page 39: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

Why do we use Icon Fonts?

Page 40: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

Does everything a normal font can!

Page 41: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

a a aa a a

They’re scalable

Page 42: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

a a aa a a

They can be styled

Page 43: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

https://www.flickr.com/photos/a_funk/3482647938/

Reduces number of HTTP requests

Page 44: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

https://www.flickr.com/photos/dajdavies/9479980440/in/photostream/

Is there a better alternative?

Page 45: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

https://www.google.com/design/icons/

SVG

Page 46: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

https://www.flickr.com/photos/anjan58/7272291392/

Accessibility

Page 47: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/

1999/xlink" width="200" height="200" aria-labelledby=“title desc" viewBox="0 0 32 32">

<title id="title">Rating star</title>

<desc id="desc">A white star with a black border.</desc>

<path fill="#444" d="M32 12.408l-11.056-1.607-4.944-10.018-4.944 10.018-11.056

1.607 8 7.798-1.889 11.011 9.889-5.199 9.889 5.199-1.889-11.011 8-7.798zM16

23.547l-6.983 3.671 1.334-7.776-5.65-5.507 7.808-1.134 3.492-7.075 3.492 7.075 7.807

1.134-5.65 5.507 1.334 7.776-6.983-3.671z"></path>

</svg>

Page 48: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/

1999/xlink" width="200" height="200" aria-labelledby=“title desc" viewBox="0 0 32 32">

<title id="title">Rating star</title>

<desc id="desc">A white star with a black border.</desc>

<path fill="#444" d="M32 12.408l-11.056-1.607-4.944-10.018-4.944 10.018-11.056

1.607 8 7.798-1.889 11.011 9.889-5.199 9.889 5.199-1.889-11.011 8-7.798zM16

23.547l-6.983 3.671 1.334-7.776-5.65-5.507 7.808-1.134 3.492-7.075 3.492 7.075 7.807

1.134-5.65 5.507 1.334 7.776-6.983-3.671z"></path>

</svg>

Page 49: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

https://www.filamentgroup.com/lab/grumpicon-workflow.html

Scalable

Page 50: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

Multi coloured!

By Peepo (Own work) [Public domain], via Wikimedia Commons

#DZY

Page 51: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

Can be animated

http://codepen.io/kyleHenwood/full/Alayb/

Page 52: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016
Page 53: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016
Page 54: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

Retina

https://www.flickr.com/photos/benm_at/8857900520/

Page 55: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

https://www.flickr.com/photos/spackletoe/90811910/

Page 56: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

<img src="smiley.svg" alt="Smiley face" role="image">

<img>

Page 57: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

<img src="smiley.svg" alt="Smiley face" role="image">

<img>

Page 58: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="20px" height="20px" viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve"> <polygon fill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" points="10,2.003 11.985,8.112 18.407,8.112 13.212,11.887 15.196,17.996 10,14.221 4.803,17.996 6.789,11.887 1.592, 8.112 8.015,8.112 "/> </svg>

<svg>

Page 59: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

<svg> <defs>

<symbol id="icon-home" viewBox="0 0 1024 1024"><title>home</title><path class="path1" d="M1024 590.444l-512-397.426-512

397.428v-162.038l512-397.426 512 397.428zM896 576v384h-256v-256h-256v256h-256v-384l384-288z"></path>

</symbol>

<symbol id="icon-newspaper" viewBox="0 0 1024 1024"><title>newspaper</title><path class="path1" d="M896 256v-128h-896v704c0 35.346 28.654 64 64

64h864c53.022 0 96-42.978 96-96v-544h-128zM832 832h-768v-640h768v640zM128 320h640v64h-640zM512 448h256v64h-256zM512 576h256v64h-256zM512 704h192v64h-192zM128 448h320v320h-320z"></path>

</symbol>

</defs></svg>

Icon System - defining

Page 60: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

Icon System - using

<svg class="inline-svg icon-home"><use xlink:href="#svg-earth"></use>

</svg>

Page 61: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

.star { background: url(star.svg); display: block; width: 83px; height: 83px; background-size: 83px 83px;}

css background

Page 62: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

Right way of doing it

Page 63: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

Supported in modern browsers

http://caniuse.com/#feat=svg

Page 64: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016
Page 65: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

“Icon font perf in Chrome is ~5x SVG atm”Addy Osmani, Google

https://www.flickr.com/photos/see_also/15049247418/

Page 66: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

Icon Fonts vs SVG

Page 67: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016
Page 68: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016
Page 69: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

Remember GitHub

Page 70: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

https://github.com/blog/2112-delivering-octicons-with-svg

Page 71: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

Context!

Page 72: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

Menu

Page 73: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

Menu

Page 74: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016
Page 75: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

Menu

Page 76: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016
Page 77: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

Menu

Menu

Menu

Page 78: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

http://i2.cdnds.net/12/30/618x377/showbiz_opening_ceremony_4.jpg

So why don’t we build it this way?

Page 79: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

https://www.flickr.com/photos/kitty-kat/6049220331/

Page 80: Death to Icon Fonts - Seren Davies - Codemotion Amsterdam 2016

@ninjanails serendavies.me ninjanails.com

https://www.flickr.com/photos/jenosaur/4051305996/