SlideShare a Scribd company logo
1 of 38
Download to read offline
HOORAY
ICON FONTS
james williamson | lynda.com
Hello.
I’m James Williamson
| senior author
@jameswillweb on the Twitter
Let’s talk about icons
“Icons are little miracle workers. They
circumvent language obstacles, give
concise warnings and directions, convey our
moods and show which buttons to press.”
-John Hicks
Icons give us a shared language
This is extremely valuable in the
mobile/responsive context
As screen real estate shrinks, icons give
us a way to clearly communicate ideas,
actions, and instructions to our users
with a minimal footprint.
How do we display icons?
Images
High overhead, painful to maintain, resolution dependent

CSS Sprites
Lower overhead, difficult to create, resolution dependent

SVG
Scalable, style-able, decent support, higher overhead

We need more responsive solutions
A more responsive solution
We need icons that scale independently of resolution
We need icons that can be styled through CSS
We need icons that are small in file size
We need icons that can be downloaded in a single file
to reduce server requests
We need ICON FONTS!
HOORAY
ICON FONTS!
(Actually, this is not exactly a new idea)
Using fonts for icons in our UI
Pros:

Cons:

Scalable
Single file request
Styles with CSS
Well-supported

Monochromatic
Tricky to make
Accessibility issues
Can be tricky to control
Icon font options
Go grab one of the dozens of high-quality, open-source
icon fonts available online
Purchase a commercial icon font
Use an icon-font hosting service like Pictos
Build your own
Using existing icon fonts
Plenty of high-quality, open-source icons available
Many include @font-face kits and code samples
You may not be able to find every icon you need
Dependent upon the icon’s style
Must be careful to avoid bloat
Building your own
Services like the Noun Project, Icomoon & Pictos allow
you to build custom icon fonts
Some allow you to choose the icons you want while
others allow you to upload your own artwork
For greater control, you can use programs like
Illustrator, Inkscape, Glyphs, FontForge, and FontLab to
build your own icon font
Using icon fonts
There are multiple ways to display icon fonts based
on coding standards, font construction, and
accessibility considerations
Despite the differences in implementations, best
practices are starting to emerge regarding icon font
syntax...
Demo

Basic icon font usage
Icons mapped to Basic Latin
HTML
<p><span	
  class=”icon”>q</span>	
  Brad	
  Frost	
  
loves	
  QR	
  Codes!</p>

CSS*
.icon	
  {
	
  	
  	
  	
  font-­‐family:	
  “Your	
  Icon	
  Font”;
}

Result:

Brad Frost loves QR Codes!

* @font-face is assumed
Icons mapped to Basic Latin
Pros:

Cons:

Easy to use

Accessibility

No complex CSS

Confuses the robots

Single rule drives all
icons

Falls back to a letter that
has no business being
there
Demo

Using generated content
Unicode mapping & generated content
HTML
<p	
  class=”icon-­‐heart”>I	
  love	
  icons!</p>

CSS*
.icon-­‐heart:before	
  {
	
  	
  	
  	
  font-­‐family:	
  “Your	
  Icon	
  Font”;
	
  	
  	
  	
  content:	
  “2661”;
	
  	
  	
  	
  display:	
  inline-­‐block;
}

Result:

I love icons!
* @font-face is assumed
Unicode mapping & generated content
Pros:

Cons:

Leaves content
untouched

Unicode mapping can
be hard to remember

You can use common
unicode values for
symbols as fallbacks

Unless you create your
own, unicode mapping
might not meet your
requirements

PUA unicode values
will fallback to an
empty glyph

Making it class-based
bloats CSS
Demo

Using the data-icon attribute
Using the data-icon attribute
HTML
<p	
  data-­‐icon=”&#x2661;”>I	
  love	
  icons!</p>

CSS*
*[data-­‐icon]:before	
  {
	
  	
  	
  	
  font-­‐family:	
  “Your	
  Icon	
  Font”;
	
  	
  	
  	
  content:	
  attr(data-­‐icon);
	
  	
  	
  	
  display:	
  inline-­‐block;
}

Result:

I love icons!
* @font-face is assumed
Using the data-icon attribute
Pros:

Cons:

Nice and semantic

Not as human readable

No need to use extra
classes
...hold up though!
Using generated content with data-icon still leaves us
with accessibility issues.
Generated content will still be read by screen
readers.
Which could be awkward.
Demo

The still even-more awesome way to accessibly
use generated content & data-icon
Using the aria-hidden attribute
HTML
<p><span	
  data-­‐icon=”&#xE001;”	
  aria-­‐hidden=”true”>	
  
</span>I	
  love	
  icons!</p>

CSS*
*[data-­‐icon]:before	
  {
	
  	
  	
  	
  font-­‐family:	
  “Your	
  Icon	
  Font”;
	
  	
  	
  	
  content:	
  attr(data-­‐icon);
	
  	
  	
  	
  display:	
  inline-­‐block;
	
  	
  	
  	
  speak:	
  none;
}

Result:

I love icons!
* @font-face is assumed
Using the aria-hidden attribute
Pros:

Cons:

Semantically clean

Requires extra markup

Well supported
Creates purely
visual content
A quick word about PUA
Unicode includes several Private Use values that are
not reserved for specific languages or characters
The Basic Multilingual Plane includes 6,400 code
points and is widely used for icon font encoding
PUA encoded glyphs will fallback to an empty glyph
if the font fails or if @font-face is not supported
BMP encoding runs from E000 - F8FF
Apple places their logo at F8FF
Using ligatures for icon fonts
HTML
<p><span	
  class=”icon”>twitter</span>	
  Tweet	
  
that!</p>

CSS*
.icon	
  {
	
  	
  	
  	
  font-­‐family:	
  “ligature	
  icons”;
	
  	
  	
  	
  text-­‐rendering:	
  	
  optimizeLegibility;
}

Result:

Tweet that!
* @font-face is assumed
Using ligatures for icon fonts
Pros:

Cons:

Easy to use

Must use a ligaturemapped icon font

Falls back to
meaningful text
If the font is mapped
correctly you can
combine techniques

Extra text in content can
be weird
Ligature support is
uneven
Tips for displaying icon fonts
Normalize them
font-weight, font-style, font-variant, text-transform...

Using inline-block gives you more control
also ensures ‘click-ability’

Although scalable, not every size displays great
try to scale along the font’s design grid

Base64 encode your fonts

avoids cross-domain Firefox issues
Tips for displaying icon fonts
Use text-rendering: optimizeLegibility for ligatures
also enables kerning pairs

Use -webkit-font-smoothing: antialiased
makes icons crisper in webkit-based browsers

Use vertical-align to control baselines on inline icons
not all icon fonts will align to the baseline the same
Taking icon fonts further
You can style font icons using any text styling property
You can animate and transform them as well
This sometimes gets a little wonky, provide fallbacks
Do icons have to be
monochrome?
No! You can create multi colored icons using multiple
glyphs
Glyphs can be overlapped using absolute positioning
You can also use zero-width characters
This requires the font to be produced with zero-width characters
Icon Fonts are not right for every project.
Before using icon fonts or an icon font
service, make sure you have a strategy in
place that matches your code aesthetics.
Icon Font Resources
Chris Coyier’s Big List of Icon Fonts
http://css-tricks.com/flat-icons-icon-fonts/

Interactive Unicode Table
http://unicode-table.com

The Noun Project

http://thenounproject.com/

Github: Building Octicons

https://github.com/blog/1135-the-making-of-octicons

Filament Group’s Icon Font Compatibility Table

https://docs.google.com/spreadsheet/ccc?
key=0Ag5_yGvxpINRdHFYeUJPNnZMWUZKR2ItMEpRTXZPdUE#gid=0

Want these slides?

http://www.slideshare.net/jameswillweb
THANK YOU
james williamson | lynda.com
jwilliamson@lynda.com
@jameswillweb on the Twitter
www.simpleprimate.com
Want these slides?
http://www.slideshare.net/jameswillweb

More Related Content

What's hot

Web Site Design Principles
Web Site Design PrinciplesWeb Site Design Principles
Web Site Design PrinciplesMukesh Tekwani
 
Developing branding solutions
Developing branding solutionsDeveloping branding solutions
Developing branding solutionsThomas Daly
 
SPSVB 1 7-2012 - getting started with share point branding
SPSVB 1 7-2012 - getting started with share point brandingSPSVB 1 7-2012 - getting started with share point branding
SPSVB 1 7-2012 - getting started with share point brandingThomas Daly
 
The Mobile Revolution
The Mobile RevolutionThe Mobile Revolution
The Mobile RevolutionD'arce Hess
 
Bad design features
Bad design featuresBad design features
Bad design featuresISM
 
Good bad ugly_presentation
Good bad ugly_presentationGood bad ugly_presentation
Good bad ugly_presentationD'arce Hess
 
Extensis Web Typography Workshop | WebVisions Portland
Extensis Web Typography Workshop | WebVisions PortlandExtensis Web Typography Workshop | WebVisions Portland
Extensis Web Typography Workshop | WebVisions PortlandExtensis
 

What's hot (7)

Web Site Design Principles
Web Site Design PrinciplesWeb Site Design Principles
Web Site Design Principles
 
Developing branding solutions
Developing branding solutionsDeveloping branding solutions
Developing branding solutions
 
SPSVB 1 7-2012 - getting started with share point branding
SPSVB 1 7-2012 - getting started with share point brandingSPSVB 1 7-2012 - getting started with share point branding
SPSVB 1 7-2012 - getting started with share point branding
 
The Mobile Revolution
The Mobile RevolutionThe Mobile Revolution
The Mobile Revolution
 
Bad design features
Bad design featuresBad design features
Bad design features
 
Good bad ugly_presentation
Good bad ugly_presentationGood bad ugly_presentation
Good bad ugly_presentation
 
Extensis Web Typography Workshop | WebVisions Portland
Extensis Web Typography Workshop | WebVisions PortlandExtensis Web Typography Workshop | WebVisions Portland
Extensis Web Typography Workshop | WebVisions Portland
 

Similar to Hooray Icon Fonts!

Hooray Icon Fonts! Artifact Conference
Hooray Icon Fonts! Artifact ConferenceHooray Icon Fonts! Artifact Conference
Hooray Icon Fonts! Artifact Conferencejameswillweb
 
Hooray Icon Fonts workshop
Hooray Icon Fonts workshopHooray Icon Fonts workshop
Hooray Icon Fonts workshopjameswillweb
 
Building Axure Icon Widget Libraries Using Web Fonts
Building Axure Icon Widget Libraries Using Web FontsBuilding Axure Icon Widget Libraries Using Web Fonts
Building Axure Icon Widget Libraries Using Web FontsSvetlin Denkov
 
Visual Experience 360 Flex
Visual Experience 360 FlexVisual Experience 360 Flex
Visual Experience 360 FlexJuan Sanchez
 
The Art of Web Design, 101
The Art of Web Design, 101The Art of Web Design, 101
The Art of Web Design, 101kellyhousholder
 
Design stunning user experience with expression blend
Design stunning user experience with expression blendDesign stunning user experience with expression blend
Design stunning user experience with expression blendKosala Nuwan Perera
 
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin..."Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...Yandex
 
Organize Your Website With Advanced CSS Tricks
Organize Your Website With Advanced CSS TricksOrganize Your Website With Advanced CSS Tricks
Organize Your Website With Advanced CSS TricksAndolasoft Inc
 
Introduction to Web Page Design OT and Network
Introduction to Web Page Design OT and NetworkIntroduction to Web Page Design OT and Network
Introduction to Web Page Design OT and NetworkNosajTriumps
 
Unify Design & Deliverables
Unify Design & DeliverablesUnify Design & Deliverables
Unify Design & Deliverablesnathanacurtis
 
Filling Your Design Toolkit: Premium Assets on a Shoestring Budget
Filling Your Design Toolkit: Premium Assets on a Shoestring BudgetFilling Your Design Toolkit: Premium Assets on a Shoestring Budget
Filling Your Design Toolkit: Premium Assets on a Shoestring BudgetMike Taylor
 
Controlling Web Typography
Controlling Web TypographyControlling Web Typography
Controlling Web TypographyTrent Walton
 
Web Designing Training In Chandigarh
Web Designing Training In ChandigarhWeb Designing Training In Chandigarh
Web Designing Training In ChandigarhExcellence Academy
 
Adobe fireworks cs5 [old version]
Adobe fireworks cs5 [old version]Adobe fireworks cs5 [old version]
Adobe fireworks cs5 [old version]Kimetenthray
 

Similar to Hooray Icon Fonts! (20)

Hooray Icon Fonts! Artifact Conference
Hooray Icon Fonts! Artifact ConferenceHooray Icon Fonts! Artifact Conference
Hooray Icon Fonts! Artifact Conference
 
Hooray Icon Fonts workshop
Hooray Icon Fonts workshopHooray Icon Fonts workshop
Hooray Icon Fonts workshop
 
Css3
Css3Css3
Css3
 
Building Axure Icon Widget Libraries Using Web Fonts
Building Axure Icon Widget Libraries Using Web FontsBuilding Axure Icon Widget Libraries Using Web Fonts
Building Axure Icon Widget Libraries Using Web Fonts
 
Visual Experience 360 Flex
Visual Experience 360 FlexVisual Experience 360 Flex
Visual Experience 360 Flex
 
Before Going Vector
Before Going VectorBefore Going Vector
Before Going Vector
 
The Art of Web Design, 101
The Art of Web Design, 101The Art of Web Design, 101
The Art of Web Design, 101
 
Design stunning user experience with expression blend
Design stunning user experience with expression blendDesign stunning user experience with expression blend
Design stunning user experience with expression blend
 
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin..."Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...
 
Organize Your Website With Advanced CSS Tricks
Organize Your Website With Advanced CSS TricksOrganize Your Website With Advanced CSS Tricks
Organize Your Website With Advanced CSS Tricks
 
Introduction to Web Page Design OT and Network
Introduction to Web Page Design OT and NetworkIntroduction to Web Page Design OT and Network
Introduction to Web Page Design OT and Network
 
Unify Design & Deliverables
Unify Design & DeliverablesUnify Design & Deliverables
Unify Design & Deliverables
 
Top 10 graphic and web design tools in 2015
Top 10 graphic and web design tools in 2015Top 10 graphic and web design tools in 2015
Top 10 graphic and web design tools in 2015
 
Filling Your Design Toolkit: Premium Assets on a Shoestring Budget
Filling Your Design Toolkit: Premium Assets on a Shoestring BudgetFilling Your Design Toolkit: Premium Assets on a Shoestring Budget
Filling Your Design Toolkit: Premium Assets on a Shoestring Budget
 
Controlling Web Typography
Controlling Web TypographyControlling Web Typography
Controlling Web Typography
 
ICONS
ICONSICONS
ICONS
 
Web Designing Training In Chandigarh
Web Designing Training In ChandigarhWeb Designing Training In Chandigarh
Web Designing Training In Chandigarh
 
Flash Web Development.pdf
Flash Web Development.pdfFlash Web Development.pdf
Flash Web Development.pdf
 
Adobe fireworks cs5 [old version]
Adobe fireworks cs5 [old version]Adobe fireworks cs5 [old version]
Adobe fireworks cs5 [old version]
 
Psd to foundation
Psd to foundationPsd to foundation
Psd to foundation
 

More from jameswillweb

A Web for Everyone
A Web for EveryoneA Web for Everyone
A Web for Everyonejameswillweb
 
Is Flexbox the Future of Layout -bdconf
Is Flexbox the Future of Layout -bdconfIs Flexbox the Future of Layout -bdconf
Is Flexbox the Future of Layout -bdconfjameswillweb
 
Developing Modern Web Interfaces with Dreamweaver CC
Developing Modern Web Interfaces with Dreamweaver CCDeveloping Modern Web Interfaces with Dreamweaver CC
Developing Modern Web Interfaces with Dreamweaver CCjameswillweb
 
Designing Responsively with Dreamweaver
Designing Responsively with DreamweaverDesigning Responsively with Dreamweaver
Designing Responsively with Dreamweaverjameswillweb
 
Is Flexbox the Future of Layout?
Is Flexbox the Future of Layout?Is Flexbox the Future of Layout?
Is Flexbox the Future of Layout?jameswillweb
 
Optimizing Sites for Mobile Devices
Optimizing Sites for Mobile DevicesOptimizing Sites for Mobile Devices
Optimizing Sites for Mobile Devicesjameswillweb
 
Optimizing Sites for Mobile Devices
Optimizing Sites for Mobile DevicesOptimizing Sites for Mobile Devices
Optimizing Sites for Mobile Devicesjameswillweb
 
CSS3 Media Queries: Mobile Elixir or CSS Snake Oil
CSS3 Media Queries: Mobile Elixir or CSS Snake OilCSS3 Media Queries: Mobile Elixir or CSS Snake Oil
CSS3 Media Queries: Mobile Elixir or CSS Snake Oiljameswillweb
 

More from jameswillweb (8)

A Web for Everyone
A Web for EveryoneA Web for Everyone
A Web for Everyone
 
Is Flexbox the Future of Layout -bdconf
Is Flexbox the Future of Layout -bdconfIs Flexbox the Future of Layout -bdconf
Is Flexbox the Future of Layout -bdconf
 
Developing Modern Web Interfaces with Dreamweaver CC
Developing Modern Web Interfaces with Dreamweaver CCDeveloping Modern Web Interfaces with Dreamweaver CC
Developing Modern Web Interfaces with Dreamweaver CC
 
Designing Responsively with Dreamweaver
Designing Responsively with DreamweaverDesigning Responsively with Dreamweaver
Designing Responsively with Dreamweaver
 
Is Flexbox the Future of Layout?
Is Flexbox the Future of Layout?Is Flexbox the Future of Layout?
Is Flexbox the Future of Layout?
 
Optimizing Sites for Mobile Devices
Optimizing Sites for Mobile DevicesOptimizing Sites for Mobile Devices
Optimizing Sites for Mobile Devices
 
Optimizing Sites for Mobile Devices
Optimizing Sites for Mobile DevicesOptimizing Sites for Mobile Devices
Optimizing Sites for Mobile Devices
 
CSS3 Media Queries: Mobile Elixir or CSS Snake Oil
CSS3 Media Queries: Mobile Elixir or CSS Snake OilCSS3 Media Queries: Mobile Elixir or CSS Snake Oil
CSS3 Media Queries: Mobile Elixir or CSS Snake Oil
 

Recently uploaded

Erfurt FH学位证,埃尔福特应用技术大学毕业证书1:1制作
Erfurt FH学位证,埃尔福特应用技术大学毕业证书1:1制作Erfurt FH学位证,埃尔福特应用技术大学毕业证书1:1制作
Erfurt FH学位证,埃尔福特应用技术大学毕业证书1:1制作f3774p8b
 
定制(Salford学位证)索尔福德大学毕业证成绩单原版一比一
定制(Salford学位证)索尔福德大学毕业证成绩单原版一比一定制(Salford学位证)索尔福德大学毕业证成绩单原版一比一
定制(Salford学位证)索尔福德大学毕业证成绩单原版一比一ss ss
 
美国IUB学位证,印第安纳大学伯明顿分校毕业证书1:1制作
美国IUB学位证,印第安纳大学伯明顿分校毕业证书1:1制作美国IUB学位证,印第安纳大学伯明顿分校毕业证书1:1制作
美国IUB学位证,印第安纳大学伯明顿分校毕业证书1:1制作ss846v0c
 
NO1 Certified Vashikaran Specialist in Uk Black Magic Specialist in Uk Black ...
NO1 Certified Vashikaran Specialist in Uk Black Magic Specialist in Uk Black ...NO1 Certified Vashikaran Specialist in Uk Black Magic Specialist in Uk Black ...
NO1 Certified Vashikaran Specialist in Uk Black Magic Specialist in Uk Black ...Amil baba
 
Call Girls Delhi {Rohini} 9711199012 high profile service
Call Girls Delhi {Rohini} 9711199012 high profile serviceCall Girls Delhi {Rohini} 9711199012 high profile service
Call Girls Delhi {Rohini} 9711199012 high profile servicerehmti665
 
existing product research b2 Sunderland Culture
existing product research b2 Sunderland Cultureexisting product research b2 Sunderland Culture
existing product research b2 Sunderland CultureChloeMeadows1
 
毕业文凭制作#回国入职#diploma#degree加拿大瑞尔森大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree加拿大瑞尔森大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree 毕业文凭制作#回国入职#diploma#degree加拿大瑞尔森大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree加拿大瑞尔森大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree z zzz
 
办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一
办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一
办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一diploma 1
 
专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degreeyuu sss
 
1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree
1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree
1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degreeyuu sss
 
Real Sure (Call Girl) in I.G.I. Airport 8377087607 Hot Call Girls In Delhi NCR
Real Sure (Call Girl) in I.G.I. Airport 8377087607 Hot Call Girls In Delhi NCRReal Sure (Call Girl) in I.G.I. Airport 8377087607 Hot Call Girls In Delhi NCR
Real Sure (Call Girl) in I.G.I. Airport 8377087607 Hot Call Girls In Delhi NCRdollysharma2066
 
NO1 WorldWide kala jadu Love Marriage Black Magic Punjab Powerful Black Magic...
NO1 WorldWide kala jadu Love Marriage Black Magic Punjab Powerful Black Magic...NO1 WorldWide kala jadu Love Marriage Black Magic Punjab Powerful Black Magic...
NO1 WorldWide kala jadu Love Marriage Black Magic Punjab Powerful Black Magic...Amil baba
 
Call Girls in Dwarka Sub City 💯Call Us 🔝8264348440🔝
Call Girls in Dwarka Sub City 💯Call Us 🔝8264348440🔝Call Girls in Dwarka Sub City 💯Call Us 🔝8264348440🔝
Call Girls in Dwarka Sub City 💯Call Us 🔝8264348440🔝soniya singh
 
vip Krishna Nagar Call Girls 9999965857 Call or WhatsApp Now Book
vip Krishna Nagar Call Girls 9999965857 Call or WhatsApp Now Bookvip Krishna Nagar Call Girls 9999965857 Call or WhatsApp Now Book
vip Krishna Nagar Call Girls 9999965857 Call or WhatsApp Now Bookmanojkuma9823
 
the cOMPUTER SYSTEM - computer hardware servicing.pptx
the cOMPUTER SYSTEM - computer hardware servicing.pptxthe cOMPUTER SYSTEM - computer hardware servicing.pptx
the cOMPUTER SYSTEM - computer hardware servicing.pptxLeaMaePahinagGarciaV
 
(办理学位证)加州州立大学北岭分校毕业证成绩单原版一比一
(办理学位证)加州州立大学北岭分校毕业证成绩单原版一比一(办理学位证)加州州立大学北岭分校毕业证成绩单原版一比一
(办理学位证)加州州立大学北岭分校毕业证成绩单原版一比一Fi sss
 
Hifi Defence Colony Call Girls Service WhatsApp -> 9999965857 Available 24x7 ...
Hifi Defence Colony Call Girls Service WhatsApp -> 9999965857 Available 24x7 ...Hifi Defence Colony Call Girls Service WhatsApp -> 9999965857 Available 24x7 ...
Hifi Defence Colony Call Girls Service WhatsApp -> 9999965857 Available 24x7 ...srsj9000
 
NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...
NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...
NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...Amil Baba Dawood bangali
 

Recently uploaded (20)

Erfurt FH学位证,埃尔福特应用技术大学毕业证书1:1制作
Erfurt FH学位证,埃尔福特应用技术大学毕业证书1:1制作Erfurt FH学位证,埃尔福特应用技术大学毕业证书1:1制作
Erfurt FH学位证,埃尔福特应用技术大学毕业证书1:1制作
 
定制(Salford学位证)索尔福德大学毕业证成绩单原版一比一
定制(Salford学位证)索尔福德大学毕业证成绩单原版一比一定制(Salford学位证)索尔福德大学毕业证成绩单原版一比一
定制(Salford学位证)索尔福德大学毕业证成绩单原版一比一
 
美国IUB学位证,印第安纳大学伯明顿分校毕业证书1:1制作
美国IUB学位证,印第安纳大学伯明顿分校毕业证书1:1制作美国IUB学位证,印第安纳大学伯明顿分校毕业证书1:1制作
美国IUB学位证,印第安纳大学伯明顿分校毕业证书1:1制作
 
Low rate Call girls in Delhi Justdial | 9953330565
Low rate Call girls in Delhi Justdial | 9953330565Low rate Call girls in Delhi Justdial | 9953330565
Low rate Call girls in Delhi Justdial | 9953330565
 
NO1 Certified Vashikaran Specialist in Uk Black Magic Specialist in Uk Black ...
NO1 Certified Vashikaran Specialist in Uk Black Magic Specialist in Uk Black ...NO1 Certified Vashikaran Specialist in Uk Black Magic Specialist in Uk Black ...
NO1 Certified Vashikaran Specialist in Uk Black Magic Specialist in Uk Black ...
 
Call Girls Delhi {Rohini} 9711199012 high profile service
Call Girls Delhi {Rohini} 9711199012 high profile serviceCall Girls Delhi {Rohini} 9711199012 high profile service
Call Girls Delhi {Rohini} 9711199012 high profile service
 
existing product research b2 Sunderland Culture
existing product research b2 Sunderland Cultureexisting product research b2 Sunderland Culture
existing product research b2 Sunderland Culture
 
毕业文凭制作#回国入职#diploma#degree加拿大瑞尔森大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree加拿大瑞尔森大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree 毕业文凭制作#回国入职#diploma#degree加拿大瑞尔森大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree加拿大瑞尔森大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
 
办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一
办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一
办理(CSU毕业证书)澳洲查理斯特大学毕业证成绩单原版一比一
 
young call girls in Khanpur,🔝 9953056974 🔝 escort Service
young call girls in  Khanpur,🔝 9953056974 🔝 escort Serviceyoung call girls in  Khanpur,🔝 9953056974 🔝 escort Service
young call girls in Khanpur,🔝 9953056974 🔝 escort Service
 
专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
专业一比一美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实工艺展示#真实防伪#diploma#degree
 
1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree
1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree
1:1原版定制美国加州州立大学东湾分校毕业证成绩单pdf电子版制作修改#真实留信入库#永久存档#真实可查#diploma#degree
 
Real Sure (Call Girl) in I.G.I. Airport 8377087607 Hot Call Girls In Delhi NCR
Real Sure (Call Girl) in I.G.I. Airport 8377087607 Hot Call Girls In Delhi NCRReal Sure (Call Girl) in I.G.I. Airport 8377087607 Hot Call Girls In Delhi NCR
Real Sure (Call Girl) in I.G.I. Airport 8377087607 Hot Call Girls In Delhi NCR
 
NO1 WorldWide kala jadu Love Marriage Black Magic Punjab Powerful Black Magic...
NO1 WorldWide kala jadu Love Marriage Black Magic Punjab Powerful Black Magic...NO1 WorldWide kala jadu Love Marriage Black Magic Punjab Powerful Black Magic...
NO1 WorldWide kala jadu Love Marriage Black Magic Punjab Powerful Black Magic...
 
Call Girls in Dwarka Sub City 💯Call Us 🔝8264348440🔝
Call Girls in Dwarka Sub City 💯Call Us 🔝8264348440🔝Call Girls in Dwarka Sub City 💯Call Us 🔝8264348440🔝
Call Girls in Dwarka Sub City 💯Call Us 🔝8264348440🔝
 
vip Krishna Nagar Call Girls 9999965857 Call or WhatsApp Now Book
vip Krishna Nagar Call Girls 9999965857 Call or WhatsApp Now Bookvip Krishna Nagar Call Girls 9999965857 Call or WhatsApp Now Book
vip Krishna Nagar Call Girls 9999965857 Call or WhatsApp Now Book
 
the cOMPUTER SYSTEM - computer hardware servicing.pptx
the cOMPUTER SYSTEM - computer hardware servicing.pptxthe cOMPUTER SYSTEM - computer hardware servicing.pptx
the cOMPUTER SYSTEM - computer hardware servicing.pptx
 
(办理学位证)加州州立大学北岭分校毕业证成绩单原版一比一
(办理学位证)加州州立大学北岭分校毕业证成绩单原版一比一(办理学位证)加州州立大学北岭分校毕业证成绩单原版一比一
(办理学位证)加州州立大学北岭分校毕业证成绩单原版一比一
 
Hifi Defence Colony Call Girls Service WhatsApp -> 9999965857 Available 24x7 ...
Hifi Defence Colony Call Girls Service WhatsApp -> 9999965857 Available 24x7 ...Hifi Defence Colony Call Girls Service WhatsApp -> 9999965857 Available 24x7 ...
Hifi Defence Colony Call Girls Service WhatsApp -> 9999965857 Available 24x7 ...
 
NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...
NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...
NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...
 

Hooray Icon Fonts!

  • 2. Hello. I’m James Williamson | senior author @jameswillweb on the Twitter
  • 3. Let’s talk about icons “Icons are little miracle workers. They circumvent language obstacles, give concise warnings and directions, convey our moods and show which buttons to press.” -John Hicks
  • 4. Icons give us a shared language
  • 5. This is extremely valuable in the mobile/responsive context
  • 6. As screen real estate shrinks, icons give us a way to clearly communicate ideas, actions, and instructions to our users with a minimal footprint.
  • 7. How do we display icons? Images High overhead, painful to maintain, resolution dependent CSS Sprites Lower overhead, difficult to create, resolution dependent SVG Scalable, style-able, decent support, higher overhead We need more responsive solutions
  • 8. A more responsive solution We need icons that scale independently of resolution We need icons that can be styled through CSS We need icons that are small in file size We need icons that can be downloaded in a single file to reduce server requests We need ICON FONTS!
  • 10. (Actually, this is not exactly a new idea)
  • 11. Using fonts for icons in our UI Pros: Cons: Scalable Single file request Styles with CSS Well-supported Monochromatic Tricky to make Accessibility issues Can be tricky to control
  • 12. Icon font options Go grab one of the dozens of high-quality, open-source icon fonts available online Purchase a commercial icon font Use an icon-font hosting service like Pictos Build your own
  • 13. Using existing icon fonts Plenty of high-quality, open-source icons available Many include @font-face kits and code samples You may not be able to find every icon you need Dependent upon the icon’s style Must be careful to avoid bloat
  • 14. Building your own Services like the Noun Project, Icomoon & Pictos allow you to build custom icon fonts Some allow you to choose the icons you want while others allow you to upload your own artwork For greater control, you can use programs like Illustrator, Inkscape, Glyphs, FontForge, and FontLab to build your own icon font
  • 15. Using icon fonts There are multiple ways to display icon fonts based on coding standards, font construction, and accessibility considerations Despite the differences in implementations, best practices are starting to emerge regarding icon font syntax...
  • 17. Icons mapped to Basic Latin HTML <p><span  class=”icon”>q</span>  Brad  Frost   loves  QR  Codes!</p> CSS* .icon  {        font-­‐family:  “Your  Icon  Font”; } Result: Brad Frost loves QR Codes! * @font-face is assumed
  • 18. Icons mapped to Basic Latin Pros: Cons: Easy to use Accessibility No complex CSS Confuses the robots Single rule drives all icons Falls back to a letter that has no business being there
  • 20. Unicode mapping & generated content HTML <p  class=”icon-­‐heart”>I  love  icons!</p> CSS* .icon-­‐heart:before  {        font-­‐family:  “Your  Icon  Font”;        content:  “2661”;        display:  inline-­‐block; } Result: I love icons! * @font-face is assumed
  • 21. Unicode mapping & generated content Pros: Cons: Leaves content untouched Unicode mapping can be hard to remember You can use common unicode values for symbols as fallbacks Unless you create your own, unicode mapping might not meet your requirements PUA unicode values will fallback to an empty glyph Making it class-based bloats CSS
  • 23. Using the data-icon attribute HTML <p  data-­‐icon=”&#x2661;”>I  love  icons!</p> CSS* *[data-­‐icon]:before  {        font-­‐family:  “Your  Icon  Font”;        content:  attr(data-­‐icon);        display:  inline-­‐block; } Result: I love icons! * @font-face is assumed
  • 24. Using the data-icon attribute Pros: Cons: Nice and semantic Not as human readable No need to use extra classes
  • 25. ...hold up though! Using generated content with data-icon still leaves us with accessibility issues. Generated content will still be read by screen readers. Which could be awkward.
  • 26. Demo The still even-more awesome way to accessibly use generated content & data-icon
  • 27. Using the aria-hidden attribute HTML <p><span  data-­‐icon=”&#xE001;”  aria-­‐hidden=”true”>   </span>I  love  icons!</p> CSS* *[data-­‐icon]:before  {        font-­‐family:  “Your  Icon  Font”;        content:  attr(data-­‐icon);        display:  inline-­‐block;        speak:  none; } Result: I love icons! * @font-face is assumed
  • 28. Using the aria-hidden attribute Pros: Cons: Semantically clean Requires extra markup Well supported Creates purely visual content
  • 29. A quick word about PUA Unicode includes several Private Use values that are not reserved for specific languages or characters The Basic Multilingual Plane includes 6,400 code points and is widely used for icon font encoding PUA encoded glyphs will fallback to an empty glyph if the font fails or if @font-face is not supported BMP encoding runs from E000 - F8FF Apple places their logo at F8FF
  • 30. Using ligatures for icon fonts HTML <p><span  class=”icon”>twitter</span>  Tweet   that!</p> CSS* .icon  {        font-­‐family:  “ligature  icons”;        text-­‐rendering:    optimizeLegibility; } Result: Tweet that! * @font-face is assumed
  • 31. Using ligatures for icon fonts Pros: Cons: Easy to use Must use a ligaturemapped icon font Falls back to meaningful text If the font is mapped correctly you can combine techniques Extra text in content can be weird Ligature support is uneven
  • 32. Tips for displaying icon fonts Normalize them font-weight, font-style, font-variant, text-transform... Using inline-block gives you more control also ensures ‘click-ability’ Although scalable, not every size displays great try to scale along the font’s design grid Base64 encode your fonts avoids cross-domain Firefox issues
  • 33. Tips for displaying icon fonts Use text-rendering: optimizeLegibility for ligatures also enables kerning pairs Use -webkit-font-smoothing: antialiased makes icons crisper in webkit-based browsers Use vertical-align to control baselines on inline icons not all icon fonts will align to the baseline the same
  • 34. Taking icon fonts further You can style font icons using any text styling property You can animate and transform them as well This sometimes gets a little wonky, provide fallbacks
  • 35. Do icons have to be monochrome? No! You can create multi colored icons using multiple glyphs Glyphs can be overlapped using absolute positioning You can also use zero-width characters This requires the font to be produced with zero-width characters
  • 36. Icon Fonts are not right for every project. Before using icon fonts or an icon font service, make sure you have a strategy in place that matches your code aesthetics.
  • 37. Icon Font Resources Chris Coyier’s Big List of Icon Fonts http://css-tricks.com/flat-icons-icon-fonts/ Interactive Unicode Table http://unicode-table.com The Noun Project http://thenounproject.com/ Github: Building Octicons https://github.com/blog/1135-the-making-of-octicons Filament Group’s Icon Font Compatibility Table https://docs.google.com/spreadsheet/ccc? key=0Ag5_yGvxpINRdHFYeUJPNnZMWUZKR2ItMEpRTXZPdUE#gid=0 Want these slides? http://www.slideshare.net/jameswillweb
  • 38. THANK YOU james williamson | lynda.com jwilliamson@lynda.com @jameswillweb on the Twitter www.simpleprimate.com Want these slides? http://www.slideshare.net/jameswillweb