Skip to content

Instantly share code, notes, and snippets.

@CodeMyUI
Created March 10, 2017 00:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CodeMyUI/ed07a0039e0c2e8644613f5194256017 to your computer and use it in GitHub Desktop.
Save CodeMyUI/ed07a0039e0c2e8644613f5194256017 to your computer and use it in GitHub Desktop.
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