<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
     xmlns:atom="http://www.w3.org/2005/Atom"
     xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:wfw="http://wellformedweb.org/CommentAPI/"
     >
  <channel>
    <title>SVG Wow!</title>
    <link>http://svg-wow.org/blog</link>
    <description></description>
    <pubDate>Mon, 03 Mar 2014 21:47:48 GMT</pubDate>
    <generator>Blogofile</generator>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Alternate Stylesheets</title>
      <link>http://svg-wow.org/blog/2010/08/14/alternate-stylesheets</link>
      <pubDate>Sat, 14 Aug 2010 18:00:00 EDT</pubDate>
      <category><![CDATA[style]]></category>
      <guid isPermaLink="true">http://svg-wow.org/blog/2010/08/14/alternate-stylesheets</guid>
      <description>Alternate Stylesheets</description>
      <content:encoded><![CDATA[
<div id="description">

    <h3>Running the demo</h3>

    <p>Click on the "Start SVG Demo" at the top of this page. Then, in the
    demo page, select the name of the alternate stylesheet to apply </p>
    <p>
        Click on the 'start svg demo' button on this page. Then select one of
        the links next to the 'select stylesheet' prompt to to enable
        the desired stylesheet (and disable the others).
    </p>

    <h3>Applying CSS styles to SVG and HTML from one stylesheet</h3>

    <p>
        SVG is fully stylable with CSS and features like
        <a href="http://www.alistapart.com/articles/alternate/">alternate
        stylesheets</a> apply. This demo shows a web page with both HTML and
        SVG content. At the top of the page, the user can select one of the
        available stylesheets which gets enabled while the others are disabled.
        This mechanisme is generally useful to allow users to select a prefered
        style, for example chosing high contrast if needed for accessibility
        reason.
    </p>
    <p>
        The demo shows how the style of SVG graphical element is subject to
        CSS styles, just like any other HTML element is and that the same
        stylesheet can naturally be used to style both SVG and HTML content.
    </p>
    <p>
        The key to turning stylesheets on or off is to change the
        <code>disabled</code> property on the <code>&lt;link&gt;</code>
        element referencing the stylesheets like so:
    </p>
    <p>

<div class="pygments_monokai"><pre><span class="kd">var</span> <span class="nx">link</span> <span class="o">=</span> <span class="p">...;</span> <span class="c1">// e.g., from document.getElementsByTagName(&quot;link&quot;);</span>
<span class="nx">link</span><span class="p">.</span><span class="nx">disabled</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span> <span class="c1">// Enables the stylesheet</span>
<span class="p">....</span>
<span class="nx">link</span><span class="p">.</span><span class="nx">disabled</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span> <span class="c1">// Disables the stylesheet</span>
</pre></div>



    </p>
    <p>
        The code for turning stylesheets on and off was inspired by the example
        found at <a href="http://www.alistapart.com/articles/alternate/">A list
        appart</a>.
    </p>


</div>
]]></content:encoded>
    </item>
  </channel>
</rss>
