-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Consider: SVG for icons? #1469
Comments
I took a swing at getting us one step closer to this in #1562 One question I'd have for maintainers would be, is there a preferred toolkit for perhaps automating building a folder of SVGs into a SVG sprite? I've done this with Grunt in the past, but I know Grunt isn't used in this project. Or would we rather include the entire font-awesome set? |
Yes yes yes for SVG, it makes much more sense semantically and technically than a font. Icons fonts were sort of a hack when more browsers supported webfonts than SVG properly, but are kind of obsolete now. That leads me to something I was thinking for a while already: move, eventually, from FontAwesome to custom designed icons. FontAwesome is fine for prototypes or when no designer is around, but at one point icons are a crucial element of visual identity, and we surely can create an icon set that is just for Mastondon. Would love to work on this! |
I'm all for it! Even if the first step is building our icon set from a folder of SVGs that starts off as FontAwesome SVG source files, and then we Art Direct from there. |
The PR that takes a step towards SVG icons isn't looking like it will be merged at this time but is still up for discussion. If you 👍 or 👎 SVG icons let's discuss! |
Font-icons can cause issues for people with low-vision who replace the document font-family, there are possible work-arounds but using SVG is the preferred option, so this gets my vote. (NB: The upcoming update to WCAG might incorporate this aspect.) |
👍 @alastc you can also add people with dyslexia who are using a specific font replacing all fonts on websites and web applications (it's not a low-vision issue). And SVG offers also better ways to label the meaning of an icon which is a good thing for people with screen readers or autistic people. |
What’s the status on this and is there anything I can do to help? |
Hey @Gargron, this ever gonna get fixed? Here’s an example implementation on CodePen. |
A good read, if reasons for switching to SVG are still needed: |
SVG Images are just so powerful. They are particularly good when trying to deliver for dark mode. |
Really enjoying Mastodon's excellent user interface. I've noticed the interface uses icons in a critical manor, so I think browser support here is important.
Support Analytics
SVG actually has a better caniuse score than webfonts.
SVG 97.96% safe (screenshot)
Webfonts 95.3% safe (screenshot)
To be fair, while SVG itself is over 97% safe to use the SVG
<use>
syntax is not as safe:But polyfills take SVG
<use>
back up to 97.96% safe.Note: Font Awesome 5 will ship with an SVG framework
The Un–Detectables
Users may leverage the user agent with user sheets or plugins that manipulate a web app's style to be more legible to them. Here is what the interface looks like when the FontAwesome font-face is overridden:
UI w/ icon font overriden (screenshot)
We have no way of detecting if a user has done this, so truth be told, web fonts are undetectably less than 95% safe to use.
Technical Difference
We'd be changing this:
to something like this:
Pros
<image>
fallback<SVG>
is more semantic for an icon.<SVG>
is for graphics,<i>
is for oblique textCons
The text was updated successfully, but these errors were encountered: