JSFiddle - React, Tailwind, and code Playground
by Kiran G
HTML
<button class="btn btn-green btn-border-o">Em</button>
CSS
.btn,
.btn-border-o:before,
.btn-border-o:after {
-webkit-transition: all 0.3s;
transition: all 0.3s;
}
.btn {
display: inline-block;
line-height: 35px;
margin: 8px;
padding: 0 15px;
font-size: 15px;
position: relative;
opacity: .999;
border: transparent;
background-color: transparent;
}
.btn-border-o {
background-color: transparent;
border: 1px solid #d0d0d0;
color: #B8B8B8;
}
.btn-border-o:before, .btn-border-o:after {
content: '';
border-style: solid;
position: absolute;
z-index: 5;
border-radius: 3px;
-webkit-box-sizing: content-box;
box-sizing: content-box;
}
.btn-border-o:before {
width: 0;
height: 100%;
border-width: 1px 0 1px 0;
top: -1px;
left: 0;
-webkit-transition-delay: 0.05s;
transition-delay: 0.05s;
}
.btn-border-o:after {
width: 100%;
height: 0;
border-width: 0 1px 0 1px;
top: 0;
left: -1px;
}
.btn-border-o:hover:before {
width: 100%;
}
.btn-border-o:hover:after {
height: 100%;
}
.btn-border-o.btn-green:before, .btn-border-o.btn-green:after {
border-color: #2ecc71;
}
.btn-border-o.btn-green:hover {
color: #2ecc71;
}