Accenture / generator-mario

Generator for Backbone/Marionette applications with lots of bells and whistles to help keep a non-trivial sized application moving forward at a breakneck pace!
Apache License 2.0
29 stars 13 forks source link

Adding glyphicon doesn't show icon, instead 404 error in get request. #7

Closed afzalhussein closed 8 years ago

afzalhussein commented 9 years ago

How to reproduce

In order to produce this error, one should use bootstrap text base icon in your main template file by using this code:

<span class="glyphicon glyphicon-th-large" aria-hidden="true"></span>

or Font Awesome text base icon code:

<i class="fa fa-windows"></i>

Inspect with the browser debugger or console and check for the font error.

http://localhost:9001/fonts/bootstrap/glyphicons-halflings-regular.woff2
Failed to load resource: the server responded with a status of 404 (Not Found)

http://localhost:9001/fonts/bootstrap/glyphicons-halflings-regular.woff
Failed to load resource: the server responded with a status of 404 (Not Found)

http://localhost:9001/fonts/bootstrap/glyphicons-halflings-regular.ttf
Failed to load resource: the server responded with a status of 404 (Not Found)
afzalhussein commented 9 years ago

If you're interested, I have chosen Grunt only in installation.

NurRehman commented 9 years ago

QuickFix for AwesomeFont is:

If you haven't added other style dependencies then your main.scss should look like this

@import 'default';
$icon-font-path: '../bower_components/bootstrap/fonts/';
$fa-font-path: '../bower_components/font-awesome/fonts';
@import '../bower_components/font-awesome/scss/font-awesome';
@import '../bower_components/bootstrap-sass/assets/stylesheets/_bootstrap';

Now test, you can actually see Font awesome icon, I would say, for now, we should go with font awesome, I can see they have an extensive library for icons and for other templates we can use regular bootstrap css.

Enjoy :smile:

lofim commented 8 years ago

@afzalhussein I've taken a look at the issue and it should be fixed now. Both for fa and bootstrap. I've also fixed some icon related file corruptions when creating the dist package in grunt workflow.

Would you guys mind testing this before we publish an updated version of the npm package?

Thanks

afzalhussein commented 8 years ago

Sure, will do.

Date: Tue, 15 Dec 2015 06:19:16 -0800 From: notifications@github.com To: generator-mario@noreply.github.com CC: afzalhussein@hotmail.com Subject: Re: [generator-mario] Adding glyphicon doesn't show icon, instead 404 error in get request. (#7)

@afzalhussein I've taken a look at the issue and it should be fixed now. Both for fa and bootstrap.

I've also fixed some icon related file corruptions when creating the dist package in grunt workflow.

Would you guys mind testing this before we publish an updated version of the npm package?

Thanks

— Reply to this email directly or view it on GitHub.

afzalhussein commented 8 years ago

It worked for envelope icon for bootstrap but not for print. fa fared even worse mario_font_test

lofim commented 8 years ago

I'm sorry but i am unable to reproduce this.

Can you describe the workflow you are using ? Does this issue arise with grunt serve, or is grunt serve:dist causing this ?

Also note that the generator package on npm has not been updated yet, so you'll need to clone the project and run npm link inside the project folder to use the latest version.

afzalhussein commented 8 years ago

K will check with link

lofim commented 8 years ago

Any progress here ?

I might close the issue and push a new version of the generator into npm. You can reopen the issue if the problem persist.