Skip to content
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

Remove font-awesome #10410

Closed
silverwind opened this issue Feb 21, 2020 · 10 comments · Fixed by #24471
Closed

Remove font-awesome #10410

silverwind opened this issue Feb 21, 2020 · 10 comments · Fixed by #24471
Labels
topic/ui Change the appearance of the Gitea UI type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@silverwind
Copy link
Member

silverwind commented Feb 21, 2020

We currently only use 4 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-check-square-o
fa-file
fa-square-o

(Last check: 2023-04-30 by @delvh)

@guillep2k guillep2k added topic/ui Change the appearance of the Gitea UI type/proposal The new feature has not been accepted yet but needs to be discussed first. labels Feb 22, 2020
@zeripath
Copy link
Contributor

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

@silverwind
Copy link
Member Author

silverwind commented Feb 22, 2020

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.

@lafriks
Copy link
Member

lafriks commented Feb 22, 2020

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

@silverwind
Copy link
Member Author

silverwind commented Feb 22, 2020

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.

@lafriks
Copy link
Member

lafriks commented Feb 22, 2020

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

@silverwind
Copy link
Member Author

silverwind commented Feb 22, 2020

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.

@lafriks
Copy link
Member

lafriks commented Feb 22, 2020

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

@silverwind
Copy link
Member Author

silverwind commented Feb 22, 2020

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.

@lafriks
Copy link
Member

lafriks commented Feb 22, 2020

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 ;)

@silverwind
Copy link
Member Author

#24471

delvh pushed a commit that referenced this issue May 1, 2023
Fixes #10410.
This PR removes around 120kB of CSS.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic/ui Change the appearance of the Gitea UI type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants