You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I compared the SVG image content to other SVG:s that work as expected, and found that the reason the other SVG:s worked in the Keystatic image preview was because they had explicit width and height attributes set on the <svg> element.
Once I updated the SVG file, it started showing up as expected in Keystatic. Since this shows properly in Astro, I suspect there might be some difference in how SVG:s are rendered in Keystatic. Perhaps they need to be forced to grow to a certain size, rather than scaling down to 0x0 which seems to be the default if they don't have explicit width and height set.
First of all, big thanks for your work with Keystatic!
The following SVG works perfectly fine in our Astro site, but shows up as an empty
0x0
image preview in Keystatic:I compared the SVG image content to other SVG:s that work as expected, and found that the reason the other SVG:s worked in the Keystatic image preview was because they had explicit
width
andheight
attributes set on the<svg>
element.Once I updated the SVG file, it started showing up as expected in Keystatic. Since this shows properly in Astro, I suspect there might be some difference in how SVG:s are rendered in Keystatic. Perhaps they need to be forced to grow to a certain size, rather than scaling down to
0x0
which seems to be the default if they don't have explicit width and height set.Versions used
We seem to be using the latest versions of Keystatic as of writing.
Happy to help debug and fix this.
The text was updated successfully, but these errors were encountered: