jasontorres / bootstrap-on-rails

A simpler implementation of Bootstap 3 for Rails. Only packaged assets. No bloat. Pure Less.
52 stars 8 forks source link

Possible glyphicons issue? #3

Closed burmjohn closed 10 years ago

burmjohn commented 11 years ago

First, thanks for making this. Awesome.

I tried to test a few glyphicons, and it seems that the URL its point to is: bootstrap/../fonts/glyphicons-halflings-regular.eot

I verified in the app the glyphicons files are located in app.com/assets/bootstrap/

If I change the css live in the browser the following works:

ex: bootstrap/glyphicons-halflings-regular.eot

Perhaps I have something incorrect? (Rails 4.0)

jehughes commented 11 years ago

Agree. Thank you for creating this gem.

I ran into the same issue. Fixed it by setting @icon-font-path: ""; in my local bootstrap-on-rails.css.less file (created per-instructions.)

Curious if this a problem or how it should work? (Also Rails 4.0)

burmjohn commented 11 years ago

@jehughes thanks for the tip, that worked perfect.

jasontorres commented 10 years ago

I have this. I should probably document this to README ;)

@icon-font-path:          "../bootstrap/";
@icon-font-name:          "glyphicons-halflings-regular";
burmjohn commented 10 years ago

@jasontorres Thank you!

eveevans commented 10 years ago

This works well in development, but not in production, I think that you need to use asset-path for the @icon-font-path:

waqar-baig commented 10 years ago

Hi,

I tried the original twitter-bootstrap-rails way. Changed my less file to less.erb, and inserted this code before importing bootstrap files.

@font-face {
  font-family: 'Glyphicons Halflings';
  src: url('<%= asset_path "glyphicons-halflings-regular.eot" %>');
  src: url('<%= asset_path "glyphicons-halflings-regular.eot?#iefix" %>') format('embedded-opentype'),
       url('<%= asset_path "glyphicons-halflings-regular.woff" %>') format('woff'),
       url('<%= asset_path "glyphicons-halflings-regular.ttf" %>') format('truetype'),
       url('<%= asset_path "glyphicons-halflings-regular.svg#glyphicons-halflingsregular" %>') format('svg');
}

Fix this issue temporarily for me.

jehughes commented 10 years ago

@waqar-baig Thanks for the suggestion to just overwrite the default. Worked for me as well until this is sorted out in some official way.

Btw, I was able to use the asset-url helper that's part of less-rails. This is what I ended up with in a file called bootstrap-icons.less.

@font-face {
  font-family: 'Glyphicons Halflings';
    src: asset-url("bootstrap/glyphicons-halflings-regular.eot");
    src: asset-url("bootstrap/glyphicons-halflings-regular.eot?#iefix") format('embedded-opentype'),
         asset-url("bootstrap/glyphicons-halflings-regular.woff") format('woff'),
         asset-url("bootstrap/glyphicons-halflings-regular.ttf") format('truetype'),
         asset-url("bootstrap/glyphicons-halflings-regular.svg#glyphicons-halflingsregular") format('svg');
}

Then in bootstrap-on-rails.css.less

@import "bootstrap/bootstrap";
@import "bootstrap-icons";
friendge commented 10 years ago

Let me echo the thanks for the Gem. I struggled with each of the solutions above. For me, the following did the trick:

@import "bootstrap/variables";

@icon-font-path: "<%=asset_path ""%>/assets/bootstrap/"; // insert your bootstrap overrides // @linkColor: red; // or import a variable file // @import "variables";

@import "bootstrap/bootstrap";