Skip to content

Instantly share code, notes, and snippets.

@CodeMyUI

CodeMyUI/index.html

Created Mar 10, 2017
Embed
What would you like to do?
Shiney Button
<div class="wrapper">
<a href="#" class="button">Shiney!</a>
</div>
$color: #2194E0;
@keyframes sheen {
0% {
transform: skewY(-45deg) translateX(0);
}
100% {
transform: skewY(-45deg) translateX(12.5em);
}
}
.wrapper {
display: block;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.button {
padding: 0.75em 2em;
text-align: center;
text-decoration: none;
color: $color;
border: 2px solid $color;
font-size: 24px;
display: inline-block;
border-radius: 0.3em;
transition: all 0.2s ease-in-out;
position: relative;
overflow: hidden;
&:before {
content: "";
background-color: rgba(255,255,255,0.5);
height: 100%;
width: 3em;
display: block;
position: absolute;
top: 0;
left: -4.5em;
transform: skewX(-45deg) translateX(0);
transition: none;
}
&:hover {
background-color: $color;
color: #fff;
border-bottom: 4px solid darken($color, 10%);
&:before {
transform: skewX(-45deg) translateX(13.5em);
transition: all 0.5s ease-in-out;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment