os-js / osjs-client

OS.js Client Module
https://manual.os-js.org/
Other
31 stars 31 forks source link

Support SVG assets #150

Closed tansiret closed 1 year ago

tansiret commented 3 years ago

Supporting svg files in themes and adjusting them to the right size by pre-defined sizes in a global css would be nice.

andersevenrud commented 3 years ago

Indeed.


From Gitter conversation:

Technically any image type is supported and the fallback is .png extension. However, the icon theme service is not currently "extension aware", so it will always favor pngs. I haven't gotten around to implementing that yet. There's two ways to solve this:

  1. Add a property in the metadata that identifies all icons as either svg or png
  2. Or have a property thats a key-value pair with the icon name and the extension

And then have the icon theme service pick the approriate extension based on that.

ajmeese7 commented 1 year ago

I just ran into this same issue implementing a new icon theme, I'm going to work on a fix. Not sure if there's a pretty way to do it or if it'll have to be "hacky", but I'll come up with something and make a PR.