- From: Nathan Long <nathanmlong@gmail.com>
- Date: Sat, 16 Aug 2014 10:45:02 -0400
- To: www-svg@w3.org
- Message-ID: <CAOXW5npYEV4sR9-GLwYaxxJyDpkjeBUJmmUnCX_TOo_ZoSJhhQ@mail.gmail.com>
The SVG Parameters doc (http://www.w3.org/TR/SVGParamPrimer/) gives
examples of passing in values that include colors. Ordinarily, one would
expect to set such values with CSS. Is there a reason that this isn't
possible, or could not be made possible?
My use case: I have a graph that I want to use multiple times in the same
document, but with different parts emphasized as I discuss them. The SVG
data is identical in every case, and it would make most sense to reference
it as an external .svg file.
For example (rough pseudocode - I don't know if <img> or <object> or <svg>
would make most sense)
<head>
<style type="text/css">
#one #some_line { stroke_width: 5px; }
#one #other_line { stroke_width: 5px; }
</style
</head>
<body>
<img id="one" src="my.svg">
<img id="two" src="my.svg">
</body>
Another use case might be a logo. Eg, the REI logo appears twice in their
home page, differing only in size and color, but requires two totally
separate images: http://www.rei.com/ It would be more efficient to download
a single SVG file and apply different CSS to the two elements that
reference it.
I thought the `use` tag would do this, but Robert Longson pointed out that
my usage was not standard: http://stackoverflow.com/a/25184858/4376
I'm mainly writing here to request that re-use with different styles be
supported in some fashion, if possible.
Thanks for taking the time to consider this! :)
--Nathan
Received on Saturday, 16 August 2014 22:13:33 UTC