I've got an inkscape SVG file loaded in with jquery-svg, which I'm trying to apply a bunch of CSS selectors to in order to ensure that items of particular layers are all of uniform colour, and to allow for mouseover effects on certain layers. It seems to have no issues respecting standard CSS rules on the SVG, but completely ignores anything with a [attribute="value"]
selector, for example:
svg g path:hover {
fill: yellow !important;
stroke-width: 4px !important;
}
Will apply these effects when on mouseover, as expected, however:
svg g[inkscape\:label="footprint"] * {
fill: white !important;
pointer-events: none;
}
Completely ignores this, resulting in the :hover events still applying to them. I also have a CSS style set up to apply rules to a legend div and the SVG, as follows:
svg g[inkscape\:label="social"] *,
div#legend div.legendEntry[name="social"] div.legendColor {
fill: orange !important;
background-color: orange;
}
which will match the div#legend div.legendEntry[name="social"] div.legendColor
without an issue, however doesn't seem to apply to the svg g[inkscape\:label="social"] *
selector.
I'm assuming this is something to do with jquery-svg or jQuery changing the DOM after the page has loaded - though this wasn't an issue when I loaded the SVG data into the page directly, without jquery-svg. I can apply styles directly though jquery-svg, however it would be nicer to be able to tell it to apply existing styles after it's loaded an SVG file.