Skip to content

Rails asset pipeline plugin and icon mappings for the awesome http://www.entypo.com/ icon font.

License

Notifications You must be signed in to change notification settings

rocodev/entypo-rails

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

entypo-rails

An asset pipeline plugin for Rails to easily add the Entypo icon font faces and an initial set of icon classes.

Entypo

The Entypo pictograms by Daniel Bruce http://www.entypo.com/ are provided in vendor. These pictograms are licensed under CC BY 3.0 and the font unter SIL Open Font License.

Installation

Add this line to your application's Gemfile:

gem 'entypo-rails'

And then execute:

$ bundle

Usage

Either use the provided mappings, based on icons-... and the :before:

// application.css[.scss]
//= require entypo
@charset "UTF-8";
<!-- some_template.html... -->
This is cool <i class="icon-thumbs-up"></i>.
Fork it on <i class="icon-social-github"></i>.

or just include the entypo font face and do the mappings yourself, go to http://localhost:3000/_entypo/charmap in your browser for a list of all unicode codepoints and CSS classes. This is only available in development mode. Alternatively check out entypo.css.scss, the social font is prefixed with .icon-social-.

// application.css[.scss]
//= require entypo-fonts
@charset "UTF-8";

// icons.css.scss (or wherever)
i.cool { font-family: 'entypo' }
i.cool:before { content: "\1F44D"; }
<!-- some_template.html... -->
This is cool <i class="cool"></i>.

Troubleshooting

In production, the fonts are digested to entypo- 4a74efb3ed26fe0c57556bcc0b7e871f... Meanhwile it's just entypo.eot in the CSS file, without the digest. Therefore the font cannot be loaded!

When compiling assets ensure to set the correct RAILS_ENV, otherwise assets or not digested in the CSS files. See this discussion for more, or simply ensure to run:

RAILS_ENV=production rake assets:precompile

Changes

2.1.0

  • Added webkit font smooting #8, by @vojto

2.0.2

  • Fix /_entypo/charmap to load correct stylesheet from app/assets
  • Switch to use UTF-8 encoded chars, by @michaelkirk

2.0.1

  • Rails 4 compatibility: only css & js files are precompiled from vendor/assets

2.0.0

  • Breaking: combined entyo and entypo social font, so entypo-social font family no longer exists
  • #2, #3, fixed display issues on Opera

1.0.2

  • Bugfix release for Rails asset pipeline

1.0.0

  • Initial release, with entypo fonts from 2012-10-31

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

About

Rails asset pipeline plugin and icon mappings for the awesome http://www.entypo.com/ icon font.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%