JSFiddle - React, Tailwind, and code Playground
by Nicolas PUJOL
HTML
<div class="btn btn-blue btn-blue-slide no_selection">click me</div>
CSS
a:hover, a:active {
color: #333;
}
.btn {
background: none repeat scroll 0 0 rgba(0, 0, 0, 0);
cursor: pointer;
display: inline-block;
font-weight: 700;
letter-spacing: 1px;
padding: 25px 80px;
position: relative;
text-transform: uppercase;
transition: all 0.3s ease 0s;
}
.btn:after {
content:'';
position: absolute;
z-index: -1;
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
transition: all 0.3s;
}
.btn-blue {
border: 3px solid #0e83cd;
color: #0e83cd;
}
.btn-blue-slide {
overflow: hidden;
}
.btn-blue-slide:after {
width: 100%;
height: 0;
top: 50%;
left: 50%;
background-color: #0e83cd;
opacity: 0;
-webkit-transform: translateX(-50%) translateY(-50%) rotate(45deg);
-moz-transform: translateX(-50%) translateY(-50%) rotate(45deg);
-ms-transform: translateX(-50%) translateY(-50%) rotate(45deg);
transform: translateX(-50%) translateY(-50%) rotate(45deg);
}
.btn-blue-slide:hover, .btn-blue-slide:active {
color: #fff;
}
.btn-blue-slide:hover:after {
height: 260%;
opacity: 1;
}
.btn-blue-slide:active:after {
height: 400%;
opacity: 1;
}
.no_selection {
-webkit-user-select: none;
/* webkit (safari, chrome) browsers */
-moz-user-select: none;
/* mozilla browsers */
-khtml-user-select: none;
/* webkit (konqueror) browsers */
-ms-user-select: none;
/* IE10+ */
}