microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.67k stars 28.68k forks source link

File icons generated css should not hardcode px sizes #229128

Open mjbvz opened 1 day ago

mjbvz commented 1 day ago

Some font based file icon themes — such as Monokai Pro — end up generating css that uses a hardcoded px value for the font size:

Image

Other, like our built-in seti icons, instead use percentages. These size values are specified in the iconThemes json

I think it would be helpful to always use relative units for these in our workbench. I'm currently trying to use the icons in chat for example, and the normal icon size is too large for inline use. For seti I can scale the icons down by setting the parent element's font size. However Monokai Pro just always uses 16px

If I add a font-size: 1em override for the icon element, I can get Monokai Pro working but this breaks seti because it needs that 150% scaling rule or else its icons are tiny

I think we should strongly encourage that icon themes use relative units (either percentages or ems) and also try converting any non-relative units we encounter

aeschli commented 1 day ago

Yes, converting makes sense.