title: Animate div from right to left with variant width CSS only
body: <p>I have the following HTML:</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>.container {
    width: auto;
    height: 32px;
    background-color: gray;
    display: inline-block;
    padding: 4px 8px;
    min-width: 400px;
    position: absolute;
  }
  
  .box {
    padding: 0 6px;
    height: 100%;
    left: 0;
    background-color: red;
    width: auto;
    display: inline-block;
    line-height: 32px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="container"&gt;
    &lt;div class="box"&gt;HELLO&lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I want to animate the div from right to left in only CSS. The issue is that the inner <code>box</code> has a variant width (due to translations).</p>
  
  <p>If I could do an animation similar to</p>
  
  <pre><code>from {
    right: 0;
  }
  
  to {
    left: 0;
  }
  </code></pre>
  
  <p>it would be exactly what I need, but unfortunately this doesn't work.</p>
  
  <p>How can I animate the inner div with a variant width from left to right using only CSS. The outer div also has a variant width.</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>I would like the inner div to never move outside the outer div.</p>
  
  <p>This is not a duplicate because the inner AND outer container have a variant/unknown width.</p>