title: How to recalculate css vw and vh values after resizing?
body: <p>I am using vw and vh values in my CSS transform. It causes the css animation to use the actual window width. In this case the cloud image moves from the left to the right of the screen.</p>
  
  <p>This works fine for any window size, except when I resize the window after the css is loaded. Is there a way to recalculate the vw value after resizing? </p>
  
  <p>I cannot use percentages because that doesn't work with transform:translate.</p>
  
  <pre><code>cloud {
      animation: cloudanimation 2s linear infinite;
  }
  
  @keyframes cloudanimation {
    0% {
      transform: translateX(10vw);
    }
  
    100% {
      transform: translateX(90vw);
      /* percentages don't work correctly with translate */
      /* transform : translateX(90%);*/
    }
  }
  </code></pre>