Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Font Awesome for Rails, with enhanced Sass stylesheets
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
app/assets/stylesheets
lib
spec
tasks
vendor/assets
.gitignore
.rspec
Gemfile
LICENSE.md
README.md
Rakefile
font_awesome_rails.gemspec

README.md

Font Awesome for Rails

Code Climate

font_awesome_rails brings the fantastic Font Awesome iconic font to the Rails asset pipeline, with a bunch of new Sass styles for semantic markup.

Semantic markup

Wouldn't be great if instead of

<a class="btn" href="..."><i class="icon-pencil"></i> Edit</a>

you could just write

<a class="edit btn" href="...">Edit</a>

so that down the line you can restyle your edit links with impunity (and save yourself some keystrokes while you're at it)?

Thanks to the mixins provided by font_awesome_rails, you can!

.edit.btn {
  @include icon(pencil);
}

Installation

Add this line to your application's Gemfile:

gem 'font_awesome_rails'

And then execute:

$ bundle

Finally, add this line to your application.css.scss:

@import 'font-awesome';

Note that you need to @import it with Sass and not *= require it with Sprockets.

Usage

For usage examples, see the project page.

Compatibility

If you've already integrated your app with Bootstrap and/or Font Awesome, you can get the classic .icon-* styles back by adding

@import 'font-awesome/classic';

to your application.css.scss.

If you're unlucky enough to need IE 7 compatibility, it's under font-awesome/ie7. Classic styles only (no mixins) so you can @import or *= require it as you see fit.

Something went wrong with that request. Please try again.