Skip to content

Instantly share code, notes, and snippets.

@jathayde
Created October 8, 2010 16:02
Show Gist options
  • Save jathayde/617027 to your computer and use it in GitHub Desktop.
Save jathayde/617027 to your computer and use it in GitHub Desktop.
/*
###############################################################################
# CSS3 BUTTON STYLING
#
# This utilizes various browser switches. We call the non-browser switch last
# in most cases so that as browsers add support for the actual attribute, we
# won't have to rewrite the CSS file.
###############################################################################
*/
button,
.btn,
input[type="submit"] {
background: #e12b16;
background: -webkit-gradient(linear, 0 top, 0 bottom, from(#f9b00d), to(#e12b16), color-stop(6%, #f58715));
background: -moz-linear-gradient(-90deg, #f9b00d, #f58715 6%, #e12b16);
-webkit-background-clip: padding-box;
border: 1px #e32c16 solid;
border-bottom-color: #a61f0f;
-webkit-border-radius: 5px; /* Saf3+, Chrome */
-moz-border-radius: 5px; /* FF1+ */
border-radius: 5px; /* Opera 10.5, IE 9.0 */
-moz-box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.2); /* FF3.5+ */
-webkit-box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.2); /* Saf3.0+, Chrome */
box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.2); /* Opera 10.5, IE 9.0 */
color: #fff;
cursor: pointer;
display: inline-block;
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
line-height: 1em;
margin-bottom: 1em;
padding: 5px 14px;
position: relative;
text-decoration: none;
text-shadow: rgba(0, 0, 0, 0.2) 0 -1px 1px;
-webkit-text-stroke: 1px transparent;
white-space:nowrap;
behavior: url("/stylesheets/ie-css3.htc"); /* Makes css3 stuff work in MSIE 6, 7, 8 */
}
button:active,
.btn:active {
-moz-box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.2), inset 0 0 9px rgba(0,0,0,0.4);
-webkit-box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.2), inset 0 0 9px rgba(0,0,0,0.4);
box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.2), inset 0 0 9px rgba(0,0,0,0.4);
behavior: url("/stylesheets/ie-css3.htc"); /* Makes css3 stuff work in MSIE 6, 7, 8 */
}
button.disabled,
.btn.disabled {
background: #ede7dc;
background: -webkit-gradient(linear, 0 top, 0 bottom, from(#dbd6cc), to(#ece6d9), color-stop(6%, #ece6d9));
background: -moz-linear-gradient(-90deg, #dbd6cc, #ece6d9 6%, #ede7dc);
border: 1px #beb9b0 solid;
border-bottom-color: #a8a49c;
color:#7d7973;
opacity: 0.5;
}
button.subdued,
.btn.subdued {
background: #ece6d9;
background: -webkit-gradient(linear, 0 top, 0 bottom, from(#dbd6cc), to(#D1C5B5), color-stop(6%, #ece6d9));
background: -moz-linear-gradient(-90deg, #dbd6cc, #ede7dc 6%, #D1C5B5);
border: 1px #beb9b0 solid;
border-bottom-color: #a8a49c;
color:#4E4C4A;
}
button.small,
.btn.small {
font-size: 0.8em;
text-transform: uppercase;
padding: 5px 14px;
}
button.tiny,
.btn.tiny,
input[type="submit"].tiny {
font-size: 0.8em;
text-transform: uppercase;
padding: 2px 10px;
}
/*input.btn.small {
padding: 3px 14px;
}*/
button.medium,
.btn.medium {
font-size: 1.0em;
}
button.large,
.btn.large,
input[type="submit"] {
font-size: 1.2em;
padding: 8px 14px 9px;
}
a.btn,
a.btn:link,
a.btn:active,
a.btn:hover,
a.btn:visited {color: #fff;}
button:active,
.btn:active {
background: #f2740e;
border: 1px #e32c16 solid;
}
button.subdued:active,
.btn.subdued:active {
background: #ece6d9;
border: 1px #a8a49c solid;
}
button.subdued a:link,
a.btn.subdued {color:#4E4C4A;}
table button,
table .btn {
margin-bottom: 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment