Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
Looking to add the icons in the sass folder. Will need to provide documentation on the project page about icon support, etc. Will add this to the subtheme.
Complementing #3 and quoting from the Icon API module project page:
Bootstrap (base theme) - Provides Icon API support for the glyphicons that come bundled with the main Bootstrap framework. Use this as an example on how to integrate your theme icons.
I think we should look next door and do whatever they're doing cause it's similar enough and seems to be working fine! :)
I added an example file for others to include zurb foundicons in the megapatch. I feel this is an appropriate balanced approach.
I'm aware of the icon api. I think it's nice but overkill to use a theme function to create an icon. Instead you could just write html or create a code field. If i'm misinformed let me know; i might be wrong here.
I have some partial uncommitted work integrating Icon API in a way similar than Bootstrap does... I did run into a little roadblock because Foundation uses fonts and Icon API doesn't support that yet, just single images and sprites (if I'm not mistaken)
Either way, I agree that it might be overkill and I'm willing to reconsider that approach but I think that a good compromise would be to actually implement all of the foundation icon sets and include all the icons too in the STARTER theme and just have them all commented out in custom.scss, so that it's really easy to enable them. The current approach makes users perform the same repetitive tasks to setup the icon sets every time...
Actually, I just implemented this without Icon API today for a project and have a really nice, SASS-y approach, so maybe commit the other issue without this and I'll handle the icon integration in here, it's similar to what you were doing anyway! :)
In case anyone's curious, the Zurb Foundicons ship with a SASS version of each icon set's styles so I just extracted and moved the common functionality to a "components/icons" partial and let each icon set live in its own partial but depend on the common functionality provided by that base partial.
@alexweber: primarily concerning #11, I've been trying to use the 'general' and 'social' icon sets simultaneously on projects, and I'm seeing overlap / conflict. Specifically, when uncomment both:
@import "components/icons-general"; and
@import "components/icons-social";
(and @import "components/icons"; of course)
and then create, for instance:
<i class="foundicon-phone"></i> and
<i class="foundicon-facebook"></i>
the 'phone' icon is generated properly, but the 'facebook' icon is actually the 'plus' sign (#003 in general icons vs social icons). Am I missing something, or doing something wrong?
Also, since Foundation Icon Fonts 3 is out, and consolidates icon sets, would it make sense to upgrade?
Comments
Comment #1
chrisjlee commentedLooking to add the icons in the sass folder. Will need to provide documentation on the project page about icon support, etc. Will add this to the subtheme.
Comment #2
chrisjlee commentedComment #3
alexweber commentedThis might be an interesting path: https://drupal.org/project/icon
Comment #4
alexweber commentedComplementing #3 and quoting from the Icon API module project page:
I think we should look next door and do whatever they're doing cause it's similar enough and seems to be working fine! :)
Comment #5
chrisjlee commentedI added an example file for others to include zurb foundicons in the megapatch. I feel this is an appropriate balanced approach.
I'm aware of the icon api. I think it's nice but overkill to use a theme function to create an icon. Instead you could just write html or create a code field. If i'm misinformed let me know; i might be wrong here.
Comment #6
chrisjlee commentedComment #7
alexweber commentedHang on Chris! :)
I have some partial uncommitted work integrating Icon API in a way similar than Bootstrap does... I did run into a little roadblock because Foundation uses fonts and Icon API doesn't support that yet, just single images and sprites (if I'm not mistaken)
Either way, I agree that it might be overkill and I'm willing to reconsider that approach but I think that a good compromise would be to actually implement all of the foundation icon sets and include all the icons too in the STARTER theme and just have them all commented out in custom.scss, so that it's really easy to enable them. The current approach makes users perform the same repetitive tasks to setup the icon sets every time...
Comment #8
chrisjlee commentedSounds good. I like that approach. Just not sure would think it's worth to maintain icon api code?
Comment #9
alexweber commented@Chris, I really don't think it is...
Actually, I just implemented this without Icon API today for a project and have a really nice, SASS-y approach, so maybe commit the other issue without this and I'll handle the icon integration in here, it's similar to what you were doing anyway! :)
Comment #10
alexweber commentedComment #11
alexweber commentedOk done!
In case anyone's curious, the Zurb Foundicons ship with a SASS version of each icon set's styles so I just extracted and moved the common functionality to a "components/icons" partial and let each icon set live in its own partial but depend on the common functionality provided by that base partial.
Tested and works like a charm!
http://drupalcode.org/project/zurb-foundation.git/commit/e677159
Comment #12
chrisjlee commentedgood stuff. thanks alex!
Comment #14
paskainos commented@alexweber: primarily concerning #11, I've been trying to use the 'general' and 'social' icon sets simultaneously on projects, and I'm seeing overlap / conflict. Specifically, when uncomment both:
@import "components/icons-general";and@import "components/icons-social";@import "components/icons";of course)and then create, for instance:
<i class="foundicon-phone"></i>and<i class="foundicon-facebook"></i>the 'phone' icon is generated properly, but the 'facebook' icon is actually the 'plus' sign (#003 in general icons vs social icons). Am I missing something, or doing something wrong?
Also, since Foundation Icon Fonts 3 is out, and consolidates icon sets, would it make sense to upgrade?