SlideShare ist ein Scribd-Unternehmen logo
1 von 42
Downloaden Sie, um offline zu lesen
ICON FONTSICON FONTSICON FONTS
HOORAYHOORAYHOORAY
james williamson | lynda.com
Hello.
I’m JamesWilliamson
@jameswillweb on the Twitter
| senior author
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, good support, higher overhead
We need more responsive solutions
Responsive icon needs
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
ICON FONTS allow us to do all those things!
(Actually, this is not exactly a new idea)
Using fonts for icons in our UI
Pros:
Scalable
Single file request
Styles with CSS
Well-supported
Cons:
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 Icomoon, Fontello, & 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...
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:
Easy to use
No complex CSS
Single rule drives all
icons
Cons:
Accessibility
Confuses the robots
Falls back to a letter that
has no business being
there
PUA and common symbol encoding
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
You can also use Unicode values that map to common
symbols as a fallback
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
Demo
Using generated content
Pros:
Leaves content
untouched
You can use common
unicode values for
symbols as fallbacks
PUA unicode values
will fallback to an
empty glyph
Cons:
Unicode mapping can
be hard to remember
Unless you create your
own, unicode mapping
might not meet your
requirements
Making it class-based
bloats CSS
Unicode mapping & generated content
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
Demo
Using the data-icon attribute
Pros:
Nice and semantic
No need to use extra
classes
Cons:
Not as human readable
Using the data-icon attribute
...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.
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
Demo
The still even-more awesome way to accessibly
use generated content & data-icon
Pros:
Semantically clean
Well supported
Creates purely
visual content
Cons:
Requires extra markup
OK, none really...
Using the aria-hidden attribute
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
Pros:
Easy to use
Falls back to
meaningful text
If the font is mapped
correctly you can
combine techniques
Cons:
Must use a ligature-
mapped icon font
Extra text in content can
be weird
Ligature support is
uneven
Using ligatures for icon fonts
Multicolor Icon Fonts
HTML
<p><span	
  data-­‐icon="&#xF100;"	
  class="maps	
  
multi"><span	
  data-­‐icon="&#xF101;"></span></p>
CSS*
span.multi	
  {
	
   position:	
  relative;
}
span.multi	
  span	
  {
	
   position:	
  absolute;
	
   top:0;
	
   left:0;
}
Result:
* @font-face is assumed
Demo
Taking icon fonts further with multicolor icons
Pros:
Versatile
Confuses people that
say you can’t do it
Cons:
Icon font must be built
with multicolor pieces
included
Requires extra markup
Using multicolor icon fonts
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 &
-moz-osx-font-smoothing: grayscale;
makes icons crisper in webkit/gecko browsers
Use vertical-align to control baselines on inline icons
not all icon fonts will align to the baseline the same
Wait a minute...
I heard that we shouldn’t use Icon Fonts!
Filament Group suggests you use SVG
Lonely Planet & Chis Coyier just switched to SVG!
SVG is pretty awesome
Native vector artwork
Built-in support for multiple colors
Accessible through the DOM
Can do cool things like animating separate parts
More styling options through CSS
...but it’s not all roses
No support IE8>, Android 2.3 & earlier
Inline SVG eliminates extra requests, but bloats code and
must be dynamically inserted to be efficient
Complex assembly without build processes like Grunticon
Likewise for fallbacks
Higher overhead than Icon Fonts
What about icon font support?
No Opera Mini
No Windows Phone 7 - 7.8
No Android 2.1
No BlackBerry 4&5 stock browser
Edge cases in most cases, but worthy of having fallback
strategies in place
So wait, which is better?
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
Icomoon
http://icomoon.io
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 YOUjames williamson | lynda.com
jwilliamson@lynda.com
@jameswillweb on the Twitter
www.simpleprimate.com
Want these slides?
http://www.slideshare.net/jameswillweb
Want the icon font used in the demos?
http://jameswillweb.github.io/chunky-mobile

Weitere Àhnliche Inhalte

Was ist angesagt?

Beyond Responsive [18F 2015]
Beyond Responsive [18F 2015]Beyond Responsive [18F 2015]
Beyond Responsive [18F 2015]Aaron Gustafson
 
Planning Adaptive Interfaces [RWD Summit 2016]
Planning Adaptive Interfaces [RWD Summit 2016]Planning Adaptive Interfaces [RWD Summit 2016]
Planning Adaptive Interfaces [RWD Summit 2016]Aaron Gustafson
 
SEF 2014 - Responsive Design in SharePoint 2013
SEF 2014 - Responsive Design in SharePoint 2013SEF 2014 - Responsive Design in SharePoint 2013
SEF 2014 - Responsive Design in SharePoint 2013Marc D Anderson
 
Class 4: Introduction to web technology entrepreneurship
Class 4: Introduction to web technology entrepreneurshipClass 4: Introduction to web technology entrepreneurship
Class 4: Introduction to web technology entrepreneurshipallanchao
 
Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web DesignJustin Avery
 
The state of front end architecture_in_2015
The state of front end architecture_in_2015The state of front end architecture_in_2015
The state of front end architecture_in_2015Aidan Foster
 
Toronto HTML5 User Group Meet Up #2 – Application Development with HTML 5
Toronto HTML5 User Group Meet Up #2 – Application Development with HTML 5Toronto HTML5 User Group Meet Up #2 – Application Development with HTML 5
Toronto HTML5 User Group Meet Up #2 – Application Development with HTML 5Nathaniel Bagnell
 
From Flash to Canvas - a penchant for black holes
From Flash to Canvas - a penchant for black holesFrom Flash to Canvas - a penchant for black holes
From Flash to Canvas - a penchant for black holesPatric Lanhed
 
Product Based Virtual Worlds For College Recruiting
Product Based Virtual Worlds For College RecruitingProduct Based Virtual Worlds For College Recruiting
Product Based Virtual Worlds For College RecruitingAndrew Hughes
 
A Responsive Design Case Study - What We Did Wrong Building ResponsiveDesign....
A Responsive Design Case Study - What We Did Wrong Building ResponsiveDesign....A Responsive Design Case Study - What We Did Wrong Building ResponsiveDesign....
A Responsive Design Case Study - What We Did Wrong Building ResponsiveDesign....Aidan Foster
 
Uxpin web ui_design_best_practices
Uxpin web ui_design_best_practicesUxpin web ui_design_best_practices
Uxpin web ui_design_best_practicesimdurgesh
 
Planning Adaptive Interfaces [EnhanceConf 2016]
Planning Adaptive Interfaces [EnhanceConf 2016]Planning Adaptive Interfaces [EnhanceConf 2016]
Planning Adaptive Interfaces [EnhanceConf 2016]Aaron Gustafson
 
Creating mobile apps without native code
Creating mobile apps without native codeCreating mobile apps without native code
Creating mobile apps without native codeJoakim Kemeny
 
Create an Animated Navigation Bar - Edge Animate Tutorial
Create an Animated Navigation Bar - Edge Animate TutorialCreate an Animated Navigation Bar - Edge Animate Tutorial
Create an Animated Navigation Bar - Edge Animate TutorialJason Hill
 
Responsive Design: Let's get Responsive!
Responsive Design: Let's get Responsive!Responsive Design: Let's get Responsive!
Responsive Design: Let's get Responsive!Courtney Jordan
 
Ap Ams Bill
Ap Ams BillAp Ams Bill
Ap Ams BillMediality
 
All The Screens: Cross Platform Design Strategies
All The Screens: Cross Platform Design StrategiesAll The Screens: Cross Platform Design Strategies
All The Screens: Cross Platform Design StrategiesTheresa Neil
 
Responsive web design ppt
Responsive web design pptResponsive web design ppt
Responsive web design pptNAWAZ KHAN
 
Mobile Design. Strategic Solutions.
Mobile Design. Strategic Solutions.Mobile Design. Strategic Solutions.
Mobile Design. Strategic Solutions.Theresa Neil
 

Was ist angesagt? (20)

Beyond Responsive [18F 2015]
Beyond Responsive [18F 2015]Beyond Responsive [18F 2015]
Beyond Responsive [18F 2015]
 
Planning Adaptive Interfaces [RWD Summit 2016]
Planning Adaptive Interfaces [RWD Summit 2016]Planning Adaptive Interfaces [RWD Summit 2016]
Planning Adaptive Interfaces [RWD Summit 2016]
 
SEF 2014 - Responsive Design in SharePoint 2013
SEF 2014 - Responsive Design in SharePoint 2013SEF 2014 - Responsive Design in SharePoint 2013
SEF 2014 - Responsive Design in SharePoint 2013
 
Class 4: Introduction to web technology entrepreneurship
Class 4: Introduction to web technology entrepreneurshipClass 4: Introduction to web technology entrepreneurship
Class 4: Introduction to web technology entrepreneurship
 
Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web Design
 
The state of front end architecture_in_2015
The state of front end architecture_in_2015The state of front end architecture_in_2015
The state of front end architecture_in_2015
 
Toronto HTML5 User Group Meet Up #2 – Application Development with HTML 5
Toronto HTML5 User Group Meet Up #2 – Application Development with HTML 5Toronto HTML5 User Group Meet Up #2 – Application Development with HTML 5
Toronto HTML5 User Group Meet Up #2 – Application Development with HTML 5
 
From Flash to Canvas - a penchant for black holes
From Flash to Canvas - a penchant for black holesFrom Flash to Canvas - a penchant for black holes
From Flash to Canvas - a penchant for black holes
 
Product Based Virtual Worlds For College Recruiting
Product Based Virtual Worlds For College RecruitingProduct Based Virtual Worlds For College Recruiting
Product Based Virtual Worlds For College Recruiting
 
A Responsive Design Case Study - What We Did Wrong Building ResponsiveDesign....
A Responsive Design Case Study - What We Did Wrong Building ResponsiveDesign....A Responsive Design Case Study - What We Did Wrong Building ResponsiveDesign....
A Responsive Design Case Study - What We Did Wrong Building ResponsiveDesign....
 
Uxpin web ui_design_best_practices
Uxpin web ui_design_best_practicesUxpin web ui_design_best_practices
Uxpin web ui_design_best_practices
 
Explaining Ajax
Explaining AjaxExplaining Ajax
Explaining Ajax
 
Planning Adaptive Interfaces [EnhanceConf 2016]
Planning Adaptive Interfaces [EnhanceConf 2016]Planning Adaptive Interfaces [EnhanceConf 2016]
Planning Adaptive Interfaces [EnhanceConf 2016]
 
Creating mobile apps without native code
Creating mobile apps without native codeCreating mobile apps without native code
Creating mobile apps without native code
 
Create an Animated Navigation Bar - Edge Animate Tutorial
Create an Animated Navigation Bar - Edge Animate TutorialCreate an Animated Navigation Bar - Edge Animate Tutorial
Create an Animated Navigation Bar - Edge Animate Tutorial
 
Responsive Design: Let's get Responsive!
Responsive Design: Let's get Responsive!Responsive Design: Let's get Responsive!
Responsive Design: Let's get Responsive!
 
Ap Ams Bill
Ap Ams BillAp Ams Bill
Ap Ams Bill
 
All The Screens: Cross Platform Design Strategies
All The Screens: Cross Platform Design StrategiesAll The Screens: Cross Platform Design Strategies
All The Screens: Cross Platform Design Strategies
 
Responsive web design ppt
Responsive web design pptResponsive web design ppt
Responsive web design ppt
 
Mobile Design. Strategic Solutions.
Mobile Design. Strategic Solutions.Mobile Design. Strategic Solutions.
Mobile Design. Strategic Solutions.
 

Ähnlich wie Hooray Icon Fonts! Artifact Conference

Hooray Icon Fonts!
Hooray Icon Fonts!Hooray Icon Fonts!
Hooray Icon Fonts!jameswillweb
 
Font icons vs inline svg - 2016
Font icons vs inline svg - 2016Font icons vs inline svg - 2016
Font icons vs inline svg - 2016Mohammad Bayat
 
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
 
Before Going Vector
Before Going VectorBefore Going Vector
Before Going Vectordavid deraedt
 
Visual Experience 360 Flex
Visual Experience 360 FlexVisual Experience 360 Flex
Visual Experience 360 FlexJuan Sanchez
 
Css3
Css3Css3
Css3Tom Fan
 
Psd to foundation
Psd to foundationPsd to foundation
Psd to foundationHtml SliceMate
 
SVG Strikes Back
SVG Strikes BackSVG Strikes Back
SVG Strikes BackMatt Baxter
 
"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
 
Familiar Tools, New Possibilities: Leveraging the Power of the Adobe Web Pub...
Familiar Tools, New Possibilities:  Leveraging the Power of the Adobe Web Pub...Familiar Tools, New Possibilities:  Leveraging the Power of the Adobe Web Pub...
Familiar Tools, New Possibilities: Leveraging the Power of the Adobe Web Pub...John Hartley
 
HTML5 apps for iOS (and probably beyond)
HTML5 apps for iOS (and probably beyond)HTML5 apps for iOS (and probably beyond)
HTML5 apps for iOS (and probably beyond)Andi Farr
 
How To Build An Accessible Web Application
How To Build An Accessible Web ApplicationHow To Build An Accessible Web Application
How To Build An Accessible Web ApplicationDennis Lembree
 
Responsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and TechniquesResponsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and TechniquesVitaly Friedman
 
Cm i padwebdev_lunch_learn
Cm i padwebdev_lunch_learnCm i padwebdev_lunch_learn
Cm i padwebdev_lunch_learnCritical Mass
 
Controlling Web Typography
Controlling Web TypographyControlling Web Typography
Controlling Web TypographyTrent Walton
 
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
 

Ähnlich wie Hooray Icon Fonts! Artifact Conference (20)

Hooray Icon Fonts!
Hooray Icon Fonts!Hooray Icon Fonts!
Hooray Icon Fonts!
 
Font icons vs inline svg - 2016
Font icons vs inline svg - 2016Font icons vs inline svg - 2016
Font icons vs inline svg - 2016
 
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
 
Before Going Vector
Before Going VectorBefore Going Vector
Before Going Vector
 
Visual Experience 360 Flex
Visual Experience 360 FlexVisual Experience 360 Flex
Visual Experience 360 Flex
 
Css3
Css3Css3
Css3
 
Psd to foundation
Psd to foundationPsd to foundation
Psd to foundation
 
Flash Web Development.pdf
Flash Web Development.pdfFlash Web Development.pdf
Flash Web Development.pdf
 
SVG Strikes Back
SVG Strikes BackSVG Strikes Back
SVG Strikes Back
 
"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
 
Media queries
Media queriesMedia queries
Media queries
 
Familiar Tools, New Possibilities: Leveraging the Power of the Adobe Web Pub...
Familiar Tools, New Possibilities:  Leveraging the Power of the Adobe Web Pub...Familiar Tools, New Possibilities:  Leveraging the Power of the Adobe Web Pub...
Familiar Tools, New Possibilities: Leveraging the Power of the Adobe Web Pub...
 
HTML5 apps for iOS (and probably beyond)
HTML5 apps for iOS (and probably beyond)HTML5 apps for iOS (and probably beyond)
HTML5 apps for iOS (and probably beyond)
 
How To Build An Accessible Web Application
How To Build An Accessible Web ApplicationHow To Build An Accessible Web Application
How To Build An Accessible Web Application
 
Responsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and TechniquesResponsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and Techniques
 
Cm i padwebdev_lunch_learn
Cm i padwebdev_lunch_learnCm i padwebdev_lunch_learn
Cm i padwebdev_lunch_learn
 
Icon Themes
Icon ThemesIcon Themes
Icon Themes
 
Controlling Web Typography
Controlling Web TypographyControlling Web Typography
Controlling Web Typography
 
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
 

Mehr von jameswillweb

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
 

Mehr von jameswillweb (6)

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
 

KĂŒrzlich hochgeladen

Kurla Call Girls Pooja Nehwal📞 9892124323 ✅ Vashi Call Service Available Nea...
Kurla Call Girls Pooja Nehwal📞 9892124323 ✅  Vashi Call Service Available Nea...Kurla Call Girls Pooja Nehwal📞 9892124323 ✅  Vashi Call Service Available Nea...
Kurla Call Girls Pooja Nehwal📞 9892124323 ✅ Vashi Call Service Available Nea...Pooja Nehwal
 
DragonBall PowerPoint Template for demo.pptx
DragonBall PowerPoint Template for demo.pptxDragonBall PowerPoint Template for demo.pptx
DragonBall PowerPoint Template for demo.pptxmirandajeremy200221
 
CBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call Girls
CBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call GirlsCBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call Girls
CBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call Girlsmodelanjalisharma4
 
AMBER GRAIN EMBROIDERY | Growing folklore elements | Root-based materials, w...
AMBER GRAIN EMBROIDERY | Growing folklore elements |  Root-based materials, w...AMBER GRAIN EMBROIDERY | Growing folklore elements |  Root-based materials, w...
AMBER GRAIN EMBROIDERY | Growing folklore elements | Root-based materials, w...BarusRa
 
Petrosains Drama Competition (PSDC).pptx
Petrosains Drama Competition (PSDC).pptxPetrosains Drama Competition (PSDC).pptx
Petrosains Drama Competition (PSDC).pptxIgnatiusAbrahamBalin
 
CALL ON ➄8923113531 🔝Call Girls Kalyanpur Lucknow best Female service đŸ§”
CALL ON ➄8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  đŸ§”CALL ON ➄8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  đŸ§”
CALL ON ➄8923113531 🔝Call Girls Kalyanpur Lucknow best Female service đŸ§”anilsa9823
 
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...Call Girls in Nagpur High Profile
 
SCRIP Lua HTTP PROGRACMACION PLC WECON CA
SCRIP Lua HTTP PROGRACMACION PLC  WECON CASCRIP Lua HTTP PROGRACMACION PLC  WECON CA
SCRIP Lua HTTP PROGRACMACION PLC WECON CANestorGamez6
 
Top Rated Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...
Top Rated  Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...Top Rated  Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...
Top Rated Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...Call Girls in Nagpur High Profile
 
(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...
(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...
(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...ranjana rawat
 
Chapter 19_DDA_TOD Policy_First Draft 2012.pdf
Chapter 19_DDA_TOD Policy_First Draft 2012.pdfChapter 19_DDA_TOD Policy_First Draft 2012.pdf
Chapter 19_DDA_TOD Policy_First Draft 2012.pdfParomita Roy
 
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...home
 
VIP Russian Call Girls in Saharanpur Deepika 8250192130 Independent Escort Se...
VIP Russian Call Girls in Saharanpur Deepika 8250192130 Independent Escort Se...VIP Russian Call Girls in Saharanpur Deepika 8250192130 Independent Escort Se...
VIP Russian Call Girls in Saharanpur Deepika 8250192130 Independent Escort Se...Suhani Kapoor
 
Fashion trends before and after covid.pptx
Fashion trends before and after covid.pptxFashion trends before and after covid.pptx
Fashion trends before and after covid.pptxVanshNarang19
 
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...kumaririma588
 
CALL ON ➄8923113531 🔝Call Girls Aminabad Lucknow best Night Fun service
CALL ON ➄8923113531 🔝Call Girls Aminabad Lucknow best Night Fun serviceCALL ON ➄8923113531 🔝Call Girls Aminabad Lucknow best Night Fun service
CALL ON ➄8923113531 🔝Call Girls Aminabad Lucknow best Night Fun serviceanilsa9823
 
Top Rated Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Call Girls in Nagpur High Profile
 
SD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptxSD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptxjanettecruzeiro1
 

KĂŒrzlich hochgeladen (20)

Kurla Call Girls Pooja Nehwal📞 9892124323 ✅ Vashi Call Service Available Nea...
Kurla Call Girls Pooja Nehwal📞 9892124323 ✅  Vashi Call Service Available Nea...Kurla Call Girls Pooja Nehwal📞 9892124323 ✅  Vashi Call Service Available Nea...
Kurla Call Girls Pooja Nehwal📞 9892124323 ✅ Vashi Call Service Available Nea...
 
young call girls in Pandav nagar 🔝 9953056974 🔝 Delhi escort Service
young call girls in Pandav nagar 🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Pandav nagar 🔝 9953056974 🔝 Delhi escort Service
young call girls in Pandav nagar 🔝 9953056974 🔝 Delhi escort Service
 
DragonBall PowerPoint Template for demo.pptx
DragonBall PowerPoint Template for demo.pptxDragonBall PowerPoint Template for demo.pptx
DragonBall PowerPoint Template for demo.pptx
 
CBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call Girls
CBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call GirlsCBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call Girls
CBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call Girls
 
AMBER GRAIN EMBROIDERY | Growing folklore elements | Root-based materials, w...
AMBER GRAIN EMBROIDERY | Growing folklore elements |  Root-based materials, w...AMBER GRAIN EMBROIDERY | Growing folklore elements |  Root-based materials, w...
AMBER GRAIN EMBROIDERY | Growing folklore elements | Root-based materials, w...
 
Petrosains Drama Competition (PSDC).pptx
Petrosains Drama Competition (PSDC).pptxPetrosains Drama Competition (PSDC).pptx
Petrosains Drama Competition (PSDC).pptx
 
CALL ON ➄8923113531 🔝Call Girls Kalyanpur Lucknow best Female service đŸ§”
CALL ON ➄8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  đŸ§”CALL ON ➄8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  đŸ§”
CALL ON ➄8923113531 🔝Call Girls Kalyanpur Lucknow best Female service đŸ§”
 
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
 
Call Girls Service Mukherjee Nagar @9999965857 Delhi đŸ«Š No Advance VVIP 🍎 SER...
Call Girls Service Mukherjee Nagar @9999965857 Delhi đŸ«Š No Advance  VVIP 🍎 SER...Call Girls Service Mukherjee Nagar @9999965857 Delhi đŸ«Š No Advance  VVIP 🍎 SER...
Call Girls Service Mukherjee Nagar @9999965857 Delhi đŸ«Š No Advance VVIP 🍎 SER...
 
SCRIP Lua HTTP PROGRACMACION PLC WECON CA
SCRIP Lua HTTP PROGRACMACION PLC  WECON CASCRIP Lua HTTP PROGRACMACION PLC  WECON CA
SCRIP Lua HTTP PROGRACMACION PLC WECON CA
 
Top Rated Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...
Top Rated  Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...Top Rated  Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...
Top Rated Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...
 
(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...
(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...
(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...
 
Chapter 19_DDA_TOD Policy_First Draft 2012.pdf
Chapter 19_DDA_TOD Policy_First Draft 2012.pdfChapter 19_DDA_TOD Policy_First Draft 2012.pdf
Chapter 19_DDA_TOD Policy_First Draft 2012.pdf
 
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
 
VIP Russian Call Girls in Saharanpur Deepika 8250192130 Independent Escort Se...
VIP Russian Call Girls in Saharanpur Deepika 8250192130 Independent Escort Se...VIP Russian Call Girls in Saharanpur Deepika 8250192130 Independent Escort Se...
VIP Russian Call Girls in Saharanpur Deepika 8250192130 Independent Escort Se...
 
Fashion trends before and after covid.pptx
Fashion trends before and after covid.pptxFashion trends before and after covid.pptx
Fashion trends before and after covid.pptx
 
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...
 
CALL ON ➄8923113531 🔝Call Girls Aminabad Lucknow best Night Fun service
CALL ON ➄8923113531 🔝Call Girls Aminabad Lucknow best Night Fun serviceCALL ON ➄8923113531 🔝Call Girls Aminabad Lucknow best Night Fun service
CALL ON ➄8923113531 🔝Call Girls Aminabad Lucknow best Night Fun service
 
Top Rated Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
 
SD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptxSD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptx
 

Hooray Icon Fonts! Artifact Conference

  • 1. ICON FONTSICON FONTSICON FONTS HOORAYHOORAYHOORAY james williamson | lynda.com
  • 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, good support, higher overhead We need more responsive solutions
  • 8. Responsive icon needs 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 ICON FONTS allow us to do all those things!
  • 9. (Actually, this is not exactly a new idea)
  • 10. Using fonts for icons in our UI Pros: Scalable Single file request Styles with CSS Well-supported Cons: Monochromatic Tricky to make Accessibility issues Can be tricky to control
  • 11. 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
  • 12. 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
  • 13. Building your own Services like the Icomoon, Fontello, & 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
  • 14. 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...
  • 15. 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
  • 16. Icons mapped to Basic Latin Pros: Easy to use No complex CSS Single rule drives all icons Cons: Accessibility Confuses the robots Falls back to a letter that has no business being there
  • 17. PUA and common symbol encoding 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 You can also use Unicode values that map to common symbols as a fallback
  • 18. 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
  • 20. Pros: Leaves content untouched You can use common unicode values for symbols as fallbacks PUA unicode values will fallback to an empty glyph Cons: Unicode mapping can be hard to remember Unless you create your own, unicode mapping might not meet your requirements Making it class-based bloats CSS Unicode mapping & generated content
  • 21. 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
  • 23. Pros: Nice and semantic No need to use extra classes Cons: Not as human readable Using the data-icon attribute
  • 24. ...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.
  • 25. 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
  • 26. Demo The still even-more awesome way to accessibly use generated content & data-icon
  • 27. Pros: Semantically clean Well supported Creates purely visual content Cons: Requires extra markup OK, none really... Using the aria-hidden attribute
  • 28. 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
  • 29. Pros: Easy to use Falls back to meaningful text If the font is mapped correctly you can combine techniques Cons: Must use a ligature- mapped icon font Extra text in content can be weird Ligature support is uneven Using ligatures for icon fonts
  • 30. Multicolor Icon Fonts HTML <p><span  data-­‐icon="&#xF100;"  class="maps   multi"><span  data-­‐icon="&#xF101;"></span></p> CSS* span.multi  {   position:  relative; } span.multi  span  {   position:  absolute;   top:0;   left:0; } Result: * @font-face is assumed
  • 31. Demo Taking icon fonts further with multicolor icons
  • 32. Pros: Versatile Confuses people that say you can’t do it Cons: Icon font must be built with multicolor pieces included Requires extra markup Using multicolor icon fonts
  • 33. 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
  • 34. Tips for displaying icon fonts Use text-rendering: optimizeLegibility for ligatures also enables kerning pairs Use -webkit-font-smoothing: antialiased & -moz-osx-font-smoothing: grayscale; makes icons crisper in webkit/gecko browsers Use vertical-align to control baselines on inline icons not all icon fonts will align to the baseline the same
  • 35. Wait a minute... I heard that we shouldn’t use Icon Fonts! Filament Group suggests you use SVG Lonely Planet & Chis Coyier just switched to SVG!
  • 36. SVG is pretty awesome Native vector artwork Built-in support for multiple colors Accessible through the DOM Can do cool things like animating separate parts More styling options through CSS
  • 37. ...but it’s not all roses No support IE8>, Android 2.3 & earlier Inline SVG eliminates extra requests, but bloats code and must be dynamically inserted to be efficient Complex assembly without build processes like Grunticon Likewise for fallbacks Higher overhead than Icon Fonts
  • 38. What about icon font support? No Opera Mini No Windows Phone 7 - 7.8 No Android 2.1 No BlackBerry 4&5 stock browser Edge cases in most cases, but worthy of having fallback strategies in place
  • 39. So wait, which is better?
  • 40. 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.
  • 41. 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 Icomoon http://icomoon.io 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
  • 42. THANK YOUjames williamson | lynda.com jwilliamson@lynda.com @jameswillweb on the Twitter www.simpleprimate.com Want these slides? http://www.slideshare.net/jameswillweb Want the icon font used in the demos? http://jameswillweb.github.io/chunky-mobile