Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Enhancement: Support for SVGs written out as <svg>...</svg> in the main page

    Hi Isomorphic,

    it turns out that SVGs with object tags wont be able to handle all the cases where it makes sense.
    This is especially true for Down/Over state transitions.
    If I have a StatefulCanvas that supports this, internally there is some <div> that changes its class from e.g. imgButton to imgButtonDown on click.

    Unfortunately such a ruleset in a CSS file linked from your SVG file does not work:
    Code:
    svg > path {fill: black !important;} /* works */
    .imgButtonOver svg > path {fill: red !important;} /* does not work */
    This is because the .imgButtonOver is not in the SVG file (but the main application) and the SVG is styled for itself by the browser if included as <object>.
    This can already solve many problems (only one SVG file-version and change the color in the one CSS all the SVGs link)
    But it can not save files in the case of hover etc.

    Therefore the SVG would need to be inlined in the normal document flow (see here, found via SO).
    It should be possible to generate a big Java class of my SVGs as base64 encoded strings with getters or similar once or as part of my build. Or one could use the GWT i18n system and properties files.
    The question then is if you can also support inlined SVG where the SVG code (=the file contents) gets provided as string and you just write it out as it is as "<svg...... </svg>".
    Then one would only need one SVG-file and could style the SVGs from skin_styles.css.

    Best regards
    Blama
Working...
X