Icons as font instead of img
Hi
Any reason you opted to include image based icons in bootstrap which are limited to the 16px dimensions?
For example http://somerandomdude.com/work/iconic/ is available as open source fonts - means you can include icons in headers, buttons of various size etc since its vector based.
Could easily be implemented with the same approach as the current icons:
i.foobar:before { content: "X" }
Yes, I second this. It would allow size and color to change (black doesn't look good on .danger, for example)
There are forks that have this implemented: For version 1.4 have a look at https://github.com/lightglitch/bootstrap-xtra (http://lightglitch.github.com/bootstrap-xtra/) For version 2.0 you can use https://github.com/jasny/bootstrap/tree/2.0-icons
I'm not expecting that this will end up in the main version of bootstrap.
I know this is why Im surprised bootstrap opted to lock them self in to the 16px corner which feels a little unorthodox to do in 2012.
It boils down to two things:
- There isn't much out there for open source icon fonts. It's a market that I suppose is wide open, but for now extremely limited.
- Aesthetically, I have a high bar and particular style I'd like to support for iconography in Bootstrap. Glyphicons gets us close to that for now.
I'm not opposed to using fonts—that'd be pretty awesome. It's just a matter of availability and quality. if anyone else has other suggestions for a font family to use, do pipe up and I'll check it out.
I'm a fan of iconic due to their licensing and quality.
@andriijas thanks for the link, nice icon sets!
@markdotto With the vector images of Glyphicons, you can easily create a font. Unfortunately this is difficult license wise. Perhaps you can talk with the designer.
@jasny, Glyphicons in bigger sizes are sold premium :(
Using a font also brings the affordance of better color control. The pure black icons (in my opinion) don't mesh well with the off-black text.
@pokonski Well sure, I'm willing to pay the 49 bucks. That still doesn't allow me to put it in bootstrap I'm afraid, since you're not allowed to distribute them. http://glyphicons.com/glyphicons-licenses/
As a FYI, I talked to Jan about it over email and he granted us use of the Halflings in Bootstrap so long as they are credited. To help further, I only added a sprite version of the icons—no individual files are added, so that helps him out some.
I'm sure it does. Used by thousands and promoted by Twitter :)
Will it at least be possible to exclude these built icons and the additional http request of an image for those who would like to use something else?
@jasny If id like to use https://github.com/jasny/bootstrap/blob/2.0-icons/lib/icons.less with main bootstrap, do I just need to include that icon.less in my less file or do I need anything else (except the font of course)?
@andriijas No that's not the way to do it. I've also modified mixins.less.
You can do a merge (with -Xours) and rebuild bootstrap. You can also fetch my fork and do a cherrypick. The whole thing is in commit https://github.com/jasny/bootstrap/commit/54b22aa388d79a67e072ea54f8429b3b427b9d11
here are some good ones too: http://www.ffdingbatsfont.com/erler/index.html FF encourages OS devs to include it.
I'll play devils advocate and throw out the issue that using fonts/font-face for icons can and does cause some accessibility concerns. For instance if you use :before or :after to generate content to show an icon, a large majority of screen readers will read that content. (not to mention ie support). If you used the current technique of <i>x<i> some text with an icon in front of it, they would also read the "x". If you were using js to create them that may be a different, I'm not sure on that.
Maybe if it was optional, and the sprite version was still included?
I've found this Set: Web Symbols Typeface http://www.justbenicestudio.com/studio/websymbols/
Web Symbols is a set of vector html-compliant typefaces, so it might be used in any size, color and browser. License OFL
I approve of websymbols!
These might be worth a look... apparently they are supposed to be accessible and won't be read by screen readers (nice set too) http://keyamoon.com/icomoon/#toHome
actually, what would be the coolest - is if any icon guru would like to make a dedicated bootstrap icon font.