Gitea: Remove font-awesome

Created on 22 Feb 2020  路  9Comments  路  Source: go-gitea/gitea

We currently only use 26 icons out of it. I suggest replacing it with individual SVGs using the same build process like for octicons. I did not find a maintained npm repo of FA SVGs so we need to manually collect SVGs from tools like icomoon, or even better, use existing icons from the octicons set.

Here are the unique fa-* strings I found in the source:

```
fa-angle-right
fa-caret-down
fa-caret-square-o-right
fa-caret-up
fa-check-square-o
fa-chevron-down
fa-chevron-right
fa-columns
fa-ellipsis-h
fa-eye
fa-eye-slash
fa-file
fa-file-text-o
fa-fw
fa-github
fa-github-square
fa-history
fa-hourglass-end
fa-lock
fa-openid
fa-pencil
fa-pencil-square-o
fa-retweet
fa-square-o
fa-times
fa-windows

kinproposal kinui

All 9 comments

I think fomantic bundles fontawesome with it - so we could just switch to use their icons.

Fomantic still uses icon fonts though which are inferior to SVGs. It will still be an improvement if to get rid of the shipped font-awesome because I think we currently load it twice.

They could be easily replaced using @fortawesome/fontawesome to include only needed svg icons

I checked those @fortawesome modules but the non-deprecated ones only export JS data which would need preprocessing to get actual SVG data out of. I'd say not worth it.

Let's source own own SVGs and re-use octicons where possible.

What is the problem with js data? This way it would be included in js file using webpack

It needs a script to extract and one has to deal with their weird format in that script. svg-sprite-loader can only deal with plain .svg files.

Octicons does it right, they publish a directory of .svg files only.

You just call dom.watch() and it automatically injects icons in html, no need to deal with anything ;)

JS injections suck. They flash empty content on page load and do not work with JS disabled.

SVG should be server-rendered primarily with ways for JS to do it too for JS-generated content.

I don't think that it would be too bad that icons would not show up with JavaScript disabled, especially since there is so much things that will not work without JavaScript enabled anyway ;)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BNolet picture BNolet  路  3Comments

jonasfranz picture jonasfranz  路  3Comments

jorise7 picture jorise7  路  3Comments

tuxfanou picture tuxfanou  路  3Comments

kifirkin picture kifirkin  路  3Comments