Foundation Icons for Rails
An easy way to use ZURB's fantastic Foundation Icons set in a Rails 3 application.
Installation
1. Add this line to your application's Gemfile:
gem 'foundation-icons-rails'
2. Add this line to your stylesheet
*= require foundation-icons
3. (Optional) Add something like this to your routes.rb file
mount Foundation::Icons::Rails::Engine => '/fi'
And then, as with most gems, execute:
$ bundle
Or install it yourself as:
$ gem install foundation-icons-rails
Usage
Icons
To use an icon, simply create a some HTML element with some special CSS classes
<span class="glyph general">l</span>
and you'll see something like this
To use the 'enclosed', or 'social' fonts, simply use<span class="glyph enclosed">l</span>
or <span class="glyph socia">l</span>
, respectively.
Obviously, you need to know exactly which icon corresponds with each letter in the three fonts (general, enclosed, social), so you may be interested in folowing the optional step 3 above, and make use of the handy....
Directory
If you've followed the optional step 3 above, you can go to the page
http://localhost:3000/fi/directory
To see a nice list of which icon corresponds to various letters, for each of the three foundation icons fonts (general, enclosed, social)
In some situations, this may be better than looking at a reference on some other website, because it shows you how the icons will look with all of the other CSS in your web application. The directory will be rendered using your default layout (usually application.html.erb
or application.html.haml
or something).
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request