Skip to content

[Version 2.0.4] Glyphicon become an outline box in production mode #333

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kobkrit opened this issue Jul 11, 2014 · 5 comments
Closed

[Version 2.0.4] Glyphicon become an outline box in production mode #333

kobkrit opened this issue Jul 11, 2014 · 5 comments
Labels

Comments

@kobkrit
Copy link

kobkrit commented Jul 11, 2014

Happened only in production mode, not in development mode.

$ mkdir test
$ yo angular-fullstack test

Use the following setting...

$ grunt serve:dist

See this..

@kingcody
Copy link
Member

This is because the style sheet referencing the glyphicon font has been moved and its relative path to the font is broken. Because the url is ../fonts/glyphicon.woff... the lookup path becomes website.com/fonts; which in this case does not exist.

Unfortunately I don't know of an elegant solution. Part of the problem is that the style sheet ends up at a public route of /app/vendor.css which resolves the relative url to /fonts/glyphicon.... You could create a folder at dist/public/fonts and copy the font files from bower_components/{bootstrap/dist,font-awesome}/fonts to that folder.

But thats not really in the spirit of the new project layout. Its really setup for your font files to go in dist/public/assests/fonts, so I personally am not sure what course of action to take. I have been looking into ways of rewriting the urls in the css files, but I haven't found anything too promising.

If anyone else has any ideas on a way to handle this, I would (and i'm sure @kobkrit would as well) love to hear them.

@meeDamian
Copy link
Contributor

Relative symlink is out of the question?

@kingcody
Copy link
Member

@chester1000, I definitely wouldn't say "out of the question". In fact atm, its probably the simplest workaround. Definitely a workaround though.

Still I'm in agreement for the time being. @kobkrit, you could use something like geddski/grunt-symlink to automate the creation of the symlinks.

your config might look something like this:

symlink: {
  fonts: {
    dest: '<%= yeoman.dist %>/public/fonts',
    relativeSrc: '../bower_components/bootstrap/dist/fonts',
    options: {type: 'dir'} // 'file' by default
  }
}

@kingcody
Copy link
Member

BTW, if you generate the project with LESS, the less task with take care of rewriting the urls properly. Just a thought if you're trying to get something up and running.

@kobkrit
Copy link
Author

kobkrit commented Jul 13, 2014

Great! Many thanks @DaftMonk and everyone.

@JaKXz JaKXz added the bug label Jul 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants