Hi Isomorphic,
could you output SmartGWT com.smartgwt.client.widgets.Img as HTML <object> instead of HTML <img>?
The reason behind this:
My application is multi tenant, where every tenant has the application in their CI, meaning their logo in the top left and all icons in their company color.
Currently a war-generation for all customers is done like this:
What's written there still holds. Additionally it is clear now that browser behavior won't change. See e.g. here and the links in the post.
Now, if you could output the com.smartgwt.client.widgets.Img (optionally) as <object>, one could style SVGs. see this test case:
test.svg:
test.html:
svg-stylesheet.css:
In all browsers, this result in this image:
If you could change the generated tag, I'd just incorporate the code from svg-stylesheet.css in skin_styles or generate it dynamically at runtime as svg-stylesheet.css.jsp.
Best regards
Blama
could you output SmartGWT com.smartgwt.client.widgets.Img as HTML <object> instead of HTML <img>?
The reason behind this:
My application is multi tenant, where every tenant has the application in their CI, meaning their logo in the top left and all icons in their company color.
Currently a war-generation for all customers is done like this:
- 1x javac
- 1x gwtc
- for every customer
- adjust server.properties
- adjust skin_styles.css
- create & replace images with a batch job
- search&replace color strings in svgs
- call inkscape for svg->png conversion
- build war
What's written there still holds. Additionally it is clear now that browser behavior won't change. See e.g. here and the links in the post.
Now, if you could output the com.smartgwt.client.widgets.Img (optionally) as <object>, one could style SVGs. see this test case:
test.svg:
Code:
<?xml-stylesheet type="text/css" href="svg-stylesheet.css" ?> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <circle cx="25" cy="25" r="24" /> </svg>
test.html:
Code:
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>SVG test</title> <link rel="stylesheet" type="text/css" href="svg-stylesheet.css" /> </head> <body> <img width=50 height=50 src="test.svg" /> <object width=50 height=50 data="test.svg" /> </body> </html>
svg-stylesheet.css:
Code:
body { border: 0; padding: 0; margin: 0; } circle { stroke: #006600; fill: #f00; }
If you could change the generated tag, I'd just incorporate the code from svg-stylesheet.css in skin_styles or generate it dynamically at runtime as svg-stylesheet.css.jsp.
Best regards
Blama
Comment