CDN for fontawesome (and perhaps more)
You've mentioned Assetic, but how do you normally handle fonts etc if you dump the css/assets? Also dump the fonts?
Wouldn't it be easier to use the CDN for FontAwesome? And perhaps also for things like jquery etc.
It does make it easier to update, is cached etc and don't have to worry about relative resources.
Or are you worried about working offline? In that case, font-awesome isn't 100% required of course, or we could make it an option (setUseCDN()?)
Any thoughts?
Or we can inline the icons as well. See https://icomoon.io/app
With that, you can select multiple icon fonts, make a selection, add a prefix, set the font name and embed the font. This should prevent issues with icon namespaces (use debugbar-icon- instead of fa-), older/newer versions, offline loading and embedding css.
The icomoon project can be exported to a .json file, with the selection + preferences, so should be easy to update it. And will probably make it easier to switch to different fonts or add some more fonts if needed in the future.
Okay, not so super easy, that doesn't support all tools. The easier way to embed them as data I can find now is using http://www.fontsquirrel.com/tools/webfont-generator Just upload the ttf file from font-awesome and copy the @fontface definitions and paste them in the css file. Seems to work fine, see https://github.com/barryvdh/laravel-debugbar/tree/master/src/Resources/vendor/font-awesome
Or do you suggest we proxy the fonts also? I now map the css/js like mydomain.com/_debugbar/assets.css (and .js) but could also do something like /_debugbar/vendor/font-awesome/css/font-awesome.min.css and let that output the actual file from the vendor dir, and also do the same for all paths etc. What would you suggest? Do you want to add something like this to the core or do you suggest you let every framework handle it?
use cnd :+1:
- CDN :+1:
- Alternative: Remove asset dependency on fontawesome.
An alternative could be to use SVG icons directly in the HTML, but not sure how that impacts everything. Similar to https://github.com/blog/2112-delivering-octicons-with-svg For example, using https://github.com/encharm/Font-Awesome-SVG-PNG