# Troubleshooting Bug: Imported SVG Badges Not Displaying

**URL:** https://meta.discourse.org/t/svg-bug/404832
**Category:** Bug
**Tags:** badges, bug
**Created:** [June 9, 2026, 10:53am UTC](https://meta.discourse.org/t/svg-bug/404832 "2026-06-09T10:53:16Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [June 9, 2026, 7:16pm UTC](https://meta.discourse.org/t/svg-bug/404832/2 "2026-06-09T19:16:04Z")

</div>

I recognize that SVG! I think that’s from Font Awesome (sprout) — and it’s not working because they don’t include dimensions by default with their icons.

Our CSS for badge images uses `width: 100%;` capped by `max-width` but 100% of 0 is still 0.

I’m adding a little fix to Discourse that will avoid this problem.

> <https://github.com/discourse/discourse/pull/40708>
>
> Reported here: https://meta.discourse.org/t/svg-bug/404832
> 
> SVGs don't always …have dimensions included, and in this case when uploaded to a custom badge the image collapses to 0. 
> 
> \<img width="500" alt="image" src="https://github.com/user-attachments/assets/083a1776-64e7-4d10-834e-15b925c57dce" /\>
> 
> This flips around the styles so that instead of setting everything to 100% and capping the maximum, we set everything to our desired dimensions and scale down using object-fit. 
> 
> This means that images without dimensions get them through CSS (avoids 100% of 0 being 0), and images that are too large will still shrink to fit the space. 
> 
> \<img width="500" alt="image" src="https://github.com/user-attachments/assets/9afe4379-cb8f-45c9-a0fd-2a5169844a39" /\>

If you update later today this should be fixed.

---

_[View the full topic](https://meta.discourse.org/t/svg-bug/404832)._
