Re: [parameters] Outline for recasting SVG Parameters on top of CSS Variables

On Sun, Nov 2, 2014 at 1:27 PM, Robert Longson <longsonr@gmail.com> wrote:
>> This gives you no ability that is not already theoretically present
>> via :target, which lets you vary your image based on the hash in the
>> url.  (This technique is heavily used already in the SVG-as-image case
>> to do "SVG stacks", or "sprite sheets" in a single SVG file.)  This is
>> just an expansion of that power to make it easier to use in more
>> complex cases.
>
> Which is why Chrome and Safari ban :target on SVG-as-an-image.

No they don't.  (Or if they do, it's a recent change, since 39beta
definitely still works.)

test.svg:
<svg xmlns="http://www.w3.org/2000/svg" width='100' height='100'>
  <text id="target" x="0" y="20" font-size="20px">target</text>
  <text id="not-target" x="0" y="40" font-size="20px">not target</text>
  <style>
  text:not(:target) { display: none; }
  </style>
</svg>

test.html:
<!DOCTYPE html>
<title>test</title>
<img src="test.svg#target">


~TJ

Received on Monday, 3 November 2014 18:25:27 UTC