Skip to content

Instantly share code, notes, and snippets.

Created May 12, 2016 06:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/c9069c4694d326bc8f1671ec235287a4 to your computer and use it in GitHub Desktop.
Save anonymous/c9069c4694d326bc8f1671ec235287a4 to your computer and use it in GitHub Desktop.
Colorful Gradient Buttons
<div class="container">
<div class="title">Colorful Gradient Buttons</div>
<br>
<a class="button red" href>Sunset</a>
<a class="button blue" href>Deep Sea</a>
<a class="button green" href>Pasture</a>
</div>
<div class="subtitle">Made with love by NathanAB</div>
@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700);
@mixin gradient($from, $to) {
background: -moz-linear-gradient(45deg, $from, $to);
background: -webkit-linear-gradient(45deg, $from, $to);
background: linear-gradient(45deg, $from, $to);
}
html {
background-color: #EAEAEA;
font-family: 'Open Sans', sans-serif;
text-align: center;
padding: 50px;
}
.container {
padding: 50px;
background-color: #F0F0F0;
display: inline-block;
border-radius: 5px;
box-shadow: 0 0 30px #CACACA;
}
.title {
font-size: 36px;
color: #333;
}
.subtitle {
font-size: 12px;
color: #333;
position: fixed;
bottom: 20px;
left: 0;
right: 0;
margin: auto;
}
a.button {
display: inline-block;
font-size: 24px;
border-radius: 3px;
color: white;
text-decoration: none;
box-shadow: 0px 2px 10px #999;
cursor: pointer;
transition: all 0.3s ease;
margin: 20px;
padding: 15px 25px;
&.red {
@include gradient(#DBA551, #85202c);
}
&.blue {
@include gradient(#7399ae, #662452);
}
&.green {
@include gradient(#B7CF4F, #298520);
}
background-size: 250% 100% !important;
background-position: 100% 0% !important;
&:hover {
background-position: 0% !important;
box-shadow: 0 0px 12px #BBB;
transition: all 0.3s ease;
transform: translateY(-1px);
}
&:active {
transform: translateY(0);
background-position: 50% !important;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment