I am trying to use an SVG as a logo in my application. Accessing directly from the themes folder works so it is not Tomcat or the browser (Chrome) that is the problem.
I have tried and failed with all of the below:
CSS background image with addStyle on a Label, MenuItem, Button
the actual SVG text in the Label with content as HTML
Embedded image from a ThemeResource attached to the layout
ThemeResource with setIcon on a Button, MenuItem
I am at my wits end. I have read through every possible SVG comment in these forums, Stackoverflow etc. Nothing works.
Thank you Marco. I believe the cause of my problem is due to the SVG image itself, not vaadin. Although I exported it as 100x33, the width and height were both still set at 100%. When I matched both the values in the viewbox and the width/height - it finally worked.
Thank you for your quick response, Marco. Such a simple thing yet frustrating when it doesn’t work.
Cheers!
Sheila
We use cookies to serve our customers and website visitors in the best possible way. Cookies are used for the proper functioning of the website and for improving the user experience, monitoring visitor traffic and marketing purposes. By continuing to browse the site, you agree to our use of cookies. You can read more about cookies here.
We use cookies to serve our customers and website visitors in the best possible way. Cookies are used for the proper functioning of the website and for improving the user experience, monitoring visitor traffic and marketing purposes. By continuing to browse the site, you agree to our use of cookies. You can read more about cookies here.