JSFiddle - React, Tailwind, and code Playground
HTML
<div class="buttonContainer">
<a class="button">Hover me</a>
<div class="border topBorder"></div>
<div class="border rightBorder"></div>
<div class="border bottomBorder"></div>
<div class="border leftBorder"></div>
</div>
CSS
@import url(http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800&subset=latin,latin-ext);
* {
box-sizing: border-box ;
-moz-box-sizing: border-box ;
-webkit-box-sizing: border-box ;
}
html, body {
font-family: 'Open Sans';
height: 100% ;
}
body {
color: #2b2b2b ;
line-height: 1 ;
}
.buttonContainer {
position: absolute ;
top: 50% ;
left: 50% ;
transform: translate(-50%,-50%) ;
-ms-transform: translate(-50%,-50%) ;
-moz-transform: translate(-50%,-50%) ;
-o-transform: translate(-50%,-50%) ;
-webkit-transform: translate(-50%,-50%) ;
}
.button {
display: block ;
font-size: 48px ;
font-weight: 800 ;
text-transform: uppercase ;
border: 10px solid #2b2b2b ;
padding: 12px 36px ;
cursor: pointer ;
transition: color .4s ;
-moz-transition: color .4s ;
-o-transition: color .4s ;
-webkit-transition: color .4s ;
}
.buttonContainer:hover .button {
color: #ffae00 ;
}
.buttonContainer .border {
position: absolute ;
background-color: #ffae00 ;
transition: width .1s, height .1s ;
-moz-transition: width .1s, height .1s ;
-o-transition: width .1s, height .1s ;
-webkit-transition: width .1s, height .1s ;
}
.buttonContainer .rightBorder {
height: 0% ;
width: 10px ;
top: 0 ;
right: 0 ;
transition-delay: .3s ;
-moz-transition-delay: .3s ;
-o-transition-delay: .3s ;
-webkit-transition-delay: .3s ;
}
.buttonContainer:hover .rightBorder {
height: 100% ;
transition-delay: 0s ;
-moz-transition-delay: 0s ;
-o-transition-delay: 0s ;
-webkit-transition-delay: 0s ;
}
.buttonContainer .bottomBorder {
width: 0% ;
height: 10px ;
bottom: 0 ;
right: 0 ;
transition-delay: .2s ;
-moz-transition-delay: .2s ;
-o-transition-delay: .2s ;
-webkit-transition-delay: .2s ;
}
.buttonContainer:hover .bottomBorder {
width: 100% ;
transition-delay: ...