How To Make Button Border Color Fill On Hover

How To Make Button Border Color Fill On Hover

Step 1

<div class="container">
  <a href="" class="btn button">Draw Border</a>
</div>

Step 2

.container{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
a{
  text-decoration: none;
}
.btn {
  cursor: pointer;
  line-height: 1.5;
  font: sans-serif;
  letter-spacing: 1.5px;
  font-size: 20px;
  text-transform: uppercase;
  padding: 10px 20px;
}
.button {
  box-shadow: inset 0 0 0 4px #58afd1;
  color: #58afd1;
  transition: color 0.25s 0.0833333333s;
  position: relative;
}
.button::before, .button::after {
  border: 0 solid transparent;
  box-sizing: border-box;
  content: '';
  pointer-events: none;
  position: absolute;
  width: 0;
  height: 0;
  bottom: 0;
  right: 0;
}
.button::before {
  border-bottom-width: 4px;
  border-left-width: 4px;
}
.button::after {
  border-top-width: 4px;
  border-right-width: 4px;
}
.button:hover {
  color: #295;
}
.button:hover::before, .button:hover::after {
  border-color: #295;
  transition: border-color 0s, width 0.25s, height 0.25s;
  width: 100%;
  height: 100%;
}
.button:hover::before {
  transition-delay: 0s, 0s, 0.25s;
}
.button:hover::after {
  transition-delay: 0s, 0.25s, 0s;
}