Code Monkey home page Code Monkey logo

font-awesome-sass-rails's Introduction

Font Awesome 3.0.2 + SASS + Rails

With SASS and fonts from Font Awesome, font-awesome-sass-rails is a gem to integrate Font Awesome to your Rails application.

It supports Rails 3.1.1 and older.

Installation

Add font-awesome-sass-rails gem to your Gemfile:

gem 'font-awesome-sass-rails'

Then add the stylesheet to your Rails assets. The simplest way to apply Font Awesome site-wide is to add a require statement in app/assets/stylesheets/application.css:

*= require _font-awesome

That's it!

If you want to manage where the stylesheet will be used or just prefer SCSS, you can use @import in a SCSS file (e.g. a new file named libs.css.scss) to import the stylesheet:

@import 'font-awesome';

(By default Rails will import all SCSS files in app/assets/stylesheets, you can change this behavior by modifying application.css.)

You can also use it with the SASS-converted Bootstrap gem, like bootstrap-sass or anjlab-bootstrap-rails. Just require/import font-awesome right after bootstrap.

IE7 Support

This gem also includes font-awesome-ie7, the stylesheet for IE7 support bundled with Font Awesome 3.0.

Use this stylesheet with conditional comment may be the best way to support IE7. But it can be difficult when it comes to assets pipeline. See this article on StackOverflow for a workaround: Using Rails 3.1 assets pipeline to conditionally use certain css

When you try this workaround, in your application-ie.css, append:

*= require _font-awesome-ie7.min

License

The font from Font Awesome is under SIL Open Font License. The SASS & CSS from Font Awesome is under the MIT License.

Others are under MIT license.

font-awesome-sass-rails's People

Contributors

caarlos0 avatar littlebtc avatar narkoz avatar nicoles avatar rmm5t avatar stevenharman avatar tarellel avatar tcarlock avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

font-awesome-sass-rails's Issues

compass/css3/font-face not found

Sass::SyntaxError in Welcome#index

Showing /.../app/views/layouts/application.html.erb where line #6 raised:

File to import not found or unreadable: compass/css3/font-face.

I just created the application, with only 'anjlab-bootstrap-rails' and 'font-awesome-sass-rails' added to the Gemfile (both updated from repository, but I also tested with default gem version)

Rails Version question

The summary states: "Font Awesome, SASS version, with assets pipeline, for Rails 3.1+"
The Readme states: "It supports Rails 3.1.1 and older."
Should the Readme state "It supports Rails 3.1.1 and newer."? I currently use font-awesome-sass-rails with Rails 3.2.x

Unable to install font-awesome-sass-rails

I followed the directions by

  1. adding this to Gem file

group :assets do
gem 'sass-rails', '> 3.2.3'
gem 'coffee-rails', '
> 3.2.1'
gem 'uglifier', '>= 1.0.3'
gem 'font-awesome-sass-rails'
end

  1. run bundle install --without production
  2. add this text to boostrap_and_override.css.scss
    @import "bootstrap";
    @import 'font-awesome';

When I try to start the rails server, I get this error (even after restarting)
Uncaught exception: Could not find font-awesome-sass-rails-2.0.0.0 in any of the sources

Any ideas?

@extend support?

I posted this in the Font Awesome GH project as well...

Maybe I am missing something, but it appears that you can't extend an icon into an element?

For example:

a.edit-thingie {
  @extend .icon-edit;
  color: blue;
}

But <a href="" class="icon-edit"></a> on its own, works as expected.

Conflicting version support info

The repo description says 
Font Awesome, SASS version, with assets pipeline, for Rails 3.1+

The README says:
It supports Rails 3.1.1 and older.

And than there is a recent commit that indicates rails 4 support?

So which is it?

New Icons Not Showing

I updated to the latest version, and can properly display old icons - but new icons fail to appear. Anything I should check? I am using:

Using font-awesome-sass-rails (2.0.0.0)
Using sass-rails (3.2.5)
Using bootstrap-sass (2.0.3.1)

Thanks for any ideas.....

P.S. I have cleared the browser cache and restarted the server and I am not precompiling assets.

font is not downloaded

I'm using:

  • bootstrap-sass (2.2.2.0)
  • font-awesome-sass-rails (3.0.0.1)
  • sass (3.2.5)
  • sass-rails (3.2.5)

Instead of showing the fonts, I just gem some "squares" or something like that. Looking at developer tools, no font is downloaded.

It was working before I update my gems today. (but I was with version 2.0.0).

BTW, my application.css.scss:

*= require_self
 *= require bootstrap-datepicker
 *= require_tree .
 */

@import "bootstrap";
body {
  padding-top: 60px;
}
@import "bootstrap-responsive";
@import "font-awesome";

@font-face {
  font-family: 'Pontano Sans';
  font-style: normal;
  font-weight: 400;
  src: local('Pontano Sans'), local('PontanoSans-Regular'), url(/assets/pontanosans.woff) format('woff');
}

*{
  font-family: 'Pontano Sans', sans-serif !important;
}

// rest of file...

The Pontano Sans in the example is working.

If I try to access http://localhost:5000/assets/fontawesome-webfont.ttf , for example, the font is downloaded as expected.

Well, I'm out of ideas here.

Asset is not timestamped

The web font asset is not timestamped, meaning that updating the font files on the server will not bust the cache when used in conjunction with a CDN.

I found out about this because I upgraded to FA 3.0 and I'm still getting version 2 of the font on our staging server.

font-url or font-path should be used, as explained here: http://guides.rubyonrails.org/asset_pipeline.html (section 2.2)

Icons broken on IE8, and assets are a bit outdated

I've set up a branch with updated assets on my fork here but I haven't had time to port your compass strip so I haven't sent a pull request.

Icons from font-awesome show up as unicode squares on IE8 during testing, and I'm not sure whether or not it's related to the fact that the font-awesome assets in this gem are several commits behind from upstream, or if this is an entirely different issue, so I just wanted to give you a heads-up, since I'm pressed for time at the moment.

Thanks for the gem!

icons do not show on heroku

works like a charm when I view it locally, shows only empty boxes when I deploy the app to heroku. Does anyone have any idea why the web-fonts are not shown properly on heroku?!

I checked the webfonts, and they are all there, but they all(fontawesome-webfont.ttf , .eot...) have a size of 0 bytes. There seems to be something going wrong when the assets are compiled by heroku...

Icons not loading in Firefox production server

The icons display properly in all browsers but Firefox. I'm currently using Cloudfront and Nginx. Here is my CORS configuration:

<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <CORSRule>
        <AllowedOrigin>*</AllowedOrigin>
        <AllowedMethod>GET</AllowedMethod>
        <MaxAgeSeconds>3000</MaxAgeSeconds>
        <AllowedHeader>*</AllowedHeader>
    </CORSRule>
</CORSConfiguration>

Any ideas?

File to import not found or unreadable: font-awesome.

I installed the 'font-awesome-sass-rails' gem as suggested, but the import in my application.css.sass fails as the file can't be found.
I can confirm that renaming vendor/stylesheets/font-awesome.scss to vendor/stylesheets/_font-awesome.scss solves the issue.

Change to $fontAwesomePath breaks font path in namespaces

It seems that after upgrading to font-awesome-sass-rails 3.0.0.0, the icons are not displaying in the browser. I see an error that the font resource cannot be found at the specified path. It now appears that it is operating in a relative manor instead of an absolute manner.

For example, I have the following admin namespace:

http://localhost:3000/admin

In the previous version, the CSS generated referenced the font-awesome font at url("/assets/fontawesome-webfont.ttf"). However, it now generates url("fontawesome-webfont.ttf"). This change now causes the browse to look for the font at

http://localhost:3000/assets/admin/fontawesome-webfont.ttf

Notice the addition of the 'admin' to the path of the font resource.

I should note that my stylesheet assets for namespaces are organized as follows:

In app/assets/stylesheets:

admin.css
admin/admin_styles.css.scss
admin/another_stylesheet.css.scss
admin/another_admin_sheet.css.scss

Where my admin.html.erb layout references only the admin.css file and admin.css does nothing but load all the files in the admin subfolder. This model was the easiest thing I could figure out to keep my app/assets folders clean and neat.

I do a similar thing for javascripts.

Is there some better way the rails community uses to organize their asset files? Assuming my organizational structure is causing this error. I'm trying to figure out how this issue got released without notice and I can only assume it is something I am doing that others are not.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.