title: How to make cross browser gradient mixin in compass, with IE9, IE8, IE7 and Opera?
body: <p>I want to make mixin for all browser including IE9  IE9, IE8, IE7 and Opera.</p>
  
  <p>Like <a href="http://www.colorzilla.com/gradient-editor/" rel="noreferrer">http://www.colorzilla.com/gradient-editor/</a> generate the code</p>
  
  <p>it generate </p>
  
  <pre><code>background: #1e5799; /* Old browsers */
  /* IE9 SVG, needs conditional override of 'filter' to 'none' */
  background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzFlNTc5OSIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjUwJSIgc3RvcC1jb2xvcj0iIzI5ODlkOCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjUxJSIgc3RvcC1jb2xvcj0iIzIwN2NjYSIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiM3ZGI5ZTgiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
  background: -moz-linear-gradient(top,  #1e5799 0%, #2989d8 50%, #207cca 51%, #7db9e8 100%); /* FF3.6+ */
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#1e5799), color-stop(50%,#2989d8), color-stop(51%,#207cca), color-stop(100%,#7db9e8)); /* Chrome,Safari4+ */
  background: -webkit-linear-gradient(top,  #1e5799 0%,#2989d8 50%,#207cca 51%,#7db9e8 100%); /* Chrome10+,Safari5.1+ */
  background: -o-linear-gradient(top,  #1e5799 0%,#2989d8 50%,#207cca 51%,#7db9e8 100%); /* Opera 11.10+ */
  background: -ms-linear-gradient(top,  #1e5799 0%,#2989d8 50%,#207cca 51%,#7db9e8 100%); /* IE10+ */
  background: linear-gradient(top,  #1e5799 0%,#2989d8 50%,#207cca 51%,#7db9e8 100%); /* W3C */
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1e5799', endColorstr='#7db9e8',GradientType=0 ); /* IE6-8 */
  </code></pre>
  
  <p>And for IE9 We need to set <code>filter:none</code></p>
  
  <blockquote>
    <p>Support for full multi-stop gradients with IE9 (using SVG). Add a
    "gradient" class to all your elements that have a gradient, and add
    the following override to your HTML to complete the IE9 support:</p>
  
  <pre><code>&lt;!--[if gte IE 9]&gt;
    &lt;style type="text/css"&gt;
      .gradient {
         filter: none;
      }
    &lt;/style&gt;
  &lt;![endif]--&gt;
  </code></pre>
  </blockquote>
  
  <p>Compass has latest module for gradient <a href="http://compass-style.org/reference/compass/css3/images/" rel="noreferrer">http://compass-style.org/reference/compass/css3/images/</a> which we can use after calling <code>$experimental-support-for-svg: true</code> and for example use like this</p>
  
  <pre><code>.gradient {@include linear-gradient(#000000, #ff0000)}
  </code></pre>
  
  <p>Which gives output like this</p>
  
  <pre><code>.gradient {
    background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwMDAwMCIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2ZmMDAwMCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');
    background-size: 100%;
    background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #000000), color-stop(100%, #ff0000));
    background-image: -webkit-linear-gradient(#000000, #ff0000);
    background-image: -moz-linear-gradient(#000000, #ff0000);
    background-image: -o-linear-gradient(#000000, #ff0000);
    background-image: -ms-linear-gradient(#000000, #ff0000);
    background-image: linear-gradient(#000000, #ff0000);
  }
  </code></pre>
  
  <p>if we compare <strong><a href="http://compass-style.org/reference/compass/css3/images/" rel="noreferrer">compass Image</a></strong> code this to colorzilla code </p>
  
  <ul>
  <li><p>it's missing which is for IE6-8</p>
  
  <p>filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1e5799', endColorstr='#7db9e8',GradientType=0 ); /*
  IE6-8 */</p></li>
  <li>and for older browsers <code>background: #1e5799; /* Old browsers */</code></li>
  <li>and it's using <code>background-image</code> instead <code>background</code></li>
  <li>and it has one extra property <code>background-size: 100%;</code></li>
  <li>and there is no instruction on this page
  <a href="http://compass-style.org/reference/compass/css3/images/" rel="noreferrer">http://compass-style.org/reference/compass/css3/images/</a> for how to
  solve <code>filter:none</code> required for IE9.</li>
  </ul>
  
  <h2>My questions:</h2>
  
  <ol>
  <li>What is the benefit of <code>background-size: 100%;</code>?</li>
  <li>What is the benefit of using <code>background-image</code> instead <code>background</code>?</li>
  <li>Is there a way to add <code>filter:none</code> to the element only for IE9 in
  Compass?</li>
  <li>How to get IE6-8 compatible code too in compass like this <code>filter:
  progid:DXImageTransform.Microsoft.gradient( startColorstr='#1e5799',
  endColorstr='#7db9e8',GradientType=0 );</code>?</li>
  </ol>