JSFiddle - React, Tailwind, and code Playground

HTML

<!DOCTYPE html>
<html>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, minimum-scale=1.0' name='viewport' />
    <body>
      <div class="change">Some content</div>
    </body>
</html>

CSS

.change{
  background: #f00;
  align-items: center;
  font-family: sans-serif;
  color: #fff;
  height: 100px;
  display: flex;
  justify-content: center;
  animation: test1 1s linear forwards;
}

@keyframes test1 {
  0% {
    height: 100px;
  }
  
  100% {
    height: 400px;
  }
}

@media only screen and (max-width: 640px) {
  .change{
    background: #0f0;
    color: #00f;
  }
  
  
  @keyframes test1 {
    0% {
      height: 100px;
    }

    100% {
      height: 200px;
    }
  }
}