<button class="button-close"></button>
//Settings
$line-height: 8px;
$line-height-hover: 15px;
$line-color: #a1905d;
$line-transition: all .2s cubic-bezier(.25,.46,.45,.94);
.button-close{
display: block;
position: relative;
width: 48px;
height: 48px;
background: #fff;
color: $line-color;
border: 1px solid #a1905d;
margin: 100px auto;
outline: none;
&:hover{
&:before{
width: $line-height-hover;
}
&:after{
width: $line-height-hover;
}
}
&:before{
content: '';
position: absolute;
left: 50%;
top: 50%;
width: 0;
height: 1px;
border-left: $line-height solid currentColor;
border-right: $line-height solid currentColor;
-webkit-transform: translate3d(-50%,-50%,0) rotate(-45deg);
transition: $line-transition;
}
&:after{
content: '';
position: absolute;
left: 50%;
top: 50%;
width: 0;
height: 1px;
border-left: $line-height solid currentColor;
border-right: $line-height solid currentColor;
-webkit-transform: translate3d(-50%,-50%,0) rotate(45deg);
transition: $line-transition;
}
}
View Compiled
This Pen doesn't use any external CSS resources.