Created
September 15, 2016 08:20
-
-
Save CodeMyUI/ec8af38c6971a3250862dbfbea23f047 to your computer and use it in GitHub Desktop.
Rainbow Bordered Button
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> | |
<a class="btn" href="#"> | |
Rainbow Bordered Button | |
</a> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// General Staging | |
body { | |
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, | |
Helvetica Neue, Helvetica, Arial, sans-serif; | |
font-weight: 300; | |
font-size: 112.5%; | |
line-height: 1.4; | |
background: url(http://cdn.backgroundhost.com/backgrounds/subtlepatterns/green_dust_scratch.png) #909ca2; | |
} | |
div { | |
position: absolute; | |
top: 50%; | |
left: 50%; | |
transform: translate(-50%, -50%); | |
} | |
// The Effect | |
.btn { | |
background: #113546; | |
color: #fff; | |
display: inline-block; | |
padding: 0.2rem 0.5rem; | |
margin: 0.5rem; | |
position: relative; | |
border-radius: 3px; | |
text-decoration: none; | |
cursor: pointer; | |
box-sizing: border-box; | |
transition: all 0.1s ease-in-out; | |
&:hover { | |
background: #021f2c; | |
color: #fff; | |
&:after { | |
border-color: #021f2c; | |
} | |
} | |
&:after { | |
content: ''; | |
display: inline-block; | |
position: absolute; | |
left: -0.5rem; | |
top: -0.5rem; | |
width: calc(100% + (1rem)); | |
height: calc(100% + (1rem)); | |
z-index: -1; | |
border: 0.375rem solid #113546; | |
border-radius: 10px; | |
background: linear-gradient(45deg, | |
#ec5f67, #f99157, #fac863, #99c794, | |
#5fb3b3, #6699cc, #c594c5); // Oceanic Next ♡ | |
box-sizing: inherit; | |
} | |
&:active:after { | |
box-shadow: inset 0 0 0.5rem #000; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment