* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
html,
body {
display: grid;
height: 100%;
place-items: center;
background-color: #212121;
}
button {
padding: 0.8em 1.8em;
border: 2px solid #fff;
position: relative;
overflow: hidden;
background-color: transparent;
text-align: center;
text-transform: uppercase;
font-size: 16px;
transition: .3s;
z-index: 1;
font-family: Verdana, Geneva, Tahoma, sans-serif;
color: #fff;
cursor: pointer;
}
button::before {
content: '';
width: 0;
height: 300%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%) rotate(45deg);
background: #ffffff;
transition: 2s ease;
display: block;
z-index: -1;
}
button:hover::before {
width: 105%;
}
button:hover {
color: #000;
}