Re:One div – The single element HTML/CSS icon database
by marcloney on Monday January 21, 2013 @06:27AM
(#5090983)
Whilst using CSS pseudo elements to generate shapes is useful, I believe it's ill suited to iconography when the better solution is to use a custom web font. We've had a lot of success here recently, being able to create cross-platform, vector icons with minimal problems with maintainability.
[ Parent
| on HN ]
Re:One div – The single element HTML/CSS icon database
by bgarbiak on Monday January 21, 2013 @07:43AM
(#5091199)
"Pure CSS" icons have smaller footprint, don't require additional request to the server, don't interfere with screen readers. Unless you need some more sophisticated shapes they are the way to go. IMHO.
In these other cases, I'd argue that SVG is better than fonts - but that's a totally different debate.
Re:One div – The single element HTML/CSS icon database
by btown on Tuesday January 22, 2013 @12:23AM
(#5095685)
You could always use a data-url SVG in the CSS file for the "best of both worlds"... and a compiler could make this a pretty painless process... but a single sprite sheet for your entire site is probably worth the extra request in most cases, since you could lazily load your icons and speed up your initial page render, rather than waiting for the CSS to fully load to display content.
But if you do want to do this, see http://jsfiddle.net/estelle/SJjJb/
Re:One div – The single element HTML/CSS icon database
by josefresco on Monday January 21, 2013 @07:05AM
(#5091080)
How are you loading the custom font?
Re:One div – The single element HTML/CSS icon database
by marcloney on Monday January 21, 2013 @07:23AM
(#5091132)
Chris Coyier has a great blog entry [1] on using and creating custom fonts but Font Squirrel [2] is my tool of choice for generating cross-browser font files and the markup to embed them.
Re:One div – The single element HTML/CSS icon database
by glenjamin on Monday January 21, 2013 @08:51AM
(#5091427)
I've used the IcoMoon app at http://icomoon.io/ a few times to good effect.
It lets you pick exactly which icons you want, from a variety of sources, and combine them into a single font.