title: Is there a more efficient way to make background position change from left to right on hover?
body: <p>This is the code I currently have to make it seem as though the left border expands on hover, even though it's just the background changing. Is there a more efficient way to write this code?</p>
  
  <p>edit: Efficient meaning a better way to write it.</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>span {
    padding: 5px;
    text-align: center;
    border-left: 5px solid black;
    background: linear-gradient(to left, yellow 50%, black 50%);
    background-size: 200%, 100%;
    background-position: right;
    transition: .5s ease;
  }
  
  span:hover {
    background-position: left;
    color: white;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;span&gt;This is some example text.&lt;/span&gt;</code></pre>
  </div>
  </div>
  </p>