missing icons render a tall, skinny svg element
See original GitHub issueI believe this is because the svg has no viewbox? The other icons have a viewbox="0 0 512 512"
. Ideally a missing icon wouldn’t disrupt the flow of the page like this.
Edit: actually it’s the .svg-inline--fa
class where a 1em height comes from. So maybe a missing SVG should have some kind of default classes?
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
SVG symbol a Good Choice for Icons - CSS-Tricks
The container around a little beaker icon might be tall and narrow. The container around a little fish perhaps short and long.
Read more >How can I make an svg scale with its parent container?
This works for me. I first create a viewBox attribute on the SVG element and set the value to "0 0 [original svg...
Read more >SVG Tutorial: How to Code SVG Icons by Hand
Follow along with the examples in this in-depth guide to learn how to draw SVG icons and simple shapes by hand.
Read more >Scaling of SVG backgrounds - CSS: Cascading Style Sheets
This article describes how scaling of SVG images is handled when using these ... This image specifies a width of 100 pixels but...
Read more >Which SVG technique performs best for way too many icons?
A typical inline SVG icon takes a fraction of a millisecond to render: ... or composing too many elements in a long scroll...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, @jrjohnson when using the
autoReplaceSvg
functionality, where you place<i>
tags and let our code pick those up and translate them into<svg>
s, missing icons look fancy, like this: https://jsfiddle.net/mwilkerson/hpw53Lzb/2/So there’s precedent there for showing that missing icon.
That was my initial suggestion above to @bgentry, to show the same “missing icon” icon. The alternative would be to leave it blank in the page and just log a message to the console.
I don’t have a really strong preference here myself, and I could see good reason to go either way.
But we definitely don’t want the current behavior. So I’ll put in a fix for that. For now, I’ll leave it blank and log to the console.
No, that wasn’t quite what I was suggesting above, however, that’s pretty close to what I had intended to be the current behavior. Currently, it logs to the console and puts out an empty SVG. The bug, as you’ve noted, is that the empty SVG messes up the flow.
So I can just make it so that the page flow is not disrupted and keep the logging as-is.