title: How to change slider color according to percentage
body: <p>I'm using this code below to create a range slider:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.slidecontainer {
    width: 100%;
  }
  
  .slider {
    -webkit-appearance: none;
    width: 100%;
    height: 25px;
    background: #e9eefc;
    outline: none;
    opacity: 0.7;
    -webkit-transition: .2s;
    transition: opacity .2s;
  }
  
  .slider:hover {
    opacity: 1;
  }
  
  .slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 25px;
    height: 25px;
    background: #313a46;
    cursor: pointer;
  }
  
  .slider::-moz-range-thumb {
    width: 25px;
    height: 25px;
    background: #04AA6D;
    cursor: pointer;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="row"&gt;
      &lt;div class="mb-3 slidecontainer"&gt;
          &lt;input class="slider" type="range" min="0" max="100" step="5"&gt;
      &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>What I need is to fill range with color, starting with blue for low percentage and ending with green for high percentage, with gradient, something like this:</p>
  <p>20%:
  <a href="https://i.stack.imgur.com/bjCVV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bjCVV.png" alt="20%" /></a></p>
  <p>100%:
  <a href="https://i.stack.imgur.com/RChof.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RChof.png" alt="100%" /></a></p>
  <p>Any ideias ? thanks</p>