JSFiddle - React, Tailwind, and code Playground

HTML

<a class="btn">Button</a>

CSS

.btn {
  position: relative;
  font-size: 40px;
  cursor: pointer;
}

.btn::before {
  content: '';
  height: 1px;
  width: 100%;
  background-color: red;
  position: absolute;
  bottom: -1px;
  right: 0;
  -webkit-transition: all 0.5s linear;
  -moz-transition: all 0.5s linear;
  -ms-transition: all 0.5s linear;
  transition: all 0.5s linear;
}

.btn::after {
  content: '';
  height: 1px;
  width: 0;
  background-color: blue;
  position: absolute;
  bottom: -1px;
  left: 0;
  -webkit-transition: all 0.5s linear;
  -moz-transition: all 0.5s linear;
  -ms-transition: all 0.5s linear;
  transition: all 0.5s linear;
  -webkit-transition-delay: 0.5s;
  -moz-transition-delay: 0.5s;
  -ms-transition-delay: 0.5s;
  transition-delay: 0.5s;
}

.btn:hover::before {
  width: 0;
}
.btn:hover::after {
  width: 100%;
}