1

I'm wanting to use an SVG for the viewcontainer part of my VS Code extension.

I've been given some PNG files to use, but unfortunately:

When just using 32x32 PNG files, the icons always show up as a blank white square in the activity bar, and if used as SVG the images don't scale properly to the container in the activity bar.

It's as though they are "zoomed in" on if using the SVG versions.

Anyone have tips or tricks to suggest working around this?

1 Answer 1

1

This the open tag of the debug.svg icon used in the action bar

<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">

Do you have a viewbox set?

Sign up to request clarification or add additional context in comments.

4 Comments

It looks like in my case that I do not. I was using a port of potrace linked on an old SO post. kilobtye.github.io/potrace that appears only to generate id, version, width, height, xmlns, path, stroke, fill, and full-rule. Would I manually be able to specify a viewBox with pixels?
I also tried adding in the viewbox property on the tag, and left it as "". I can preview the image in VS Code with SVG Viewer extension, but still shows up blank in the activity bar :*(
set the viewbox to the same size of the width and height, most likely an empty viewbox equals no-viewbox
thanks for the tips. I was able to end up fiddling with the values in viewbox along with the height and width settings, eventually got it to work. Much appreciated!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.