Skip to content

Instantly share code, notes, and snippets.

@stripthis
Last active December 19, 2015 19:38
Show Gist options
  • Select an option

  • Save stripthis/6007359 to your computer and use it in GitHub Desktop.

Select an option

Save stripthis/6007359 to your computer and use it in GitHub Desktop.
/* ==========================================================================
Buttons
========================================================================== */
/*
Generic button
Description : We support <input[submit]>, <input.button>, <button> and <a.button>
Compatible : IE6+, Firefox 2+, Safari 4+, Chrome 1+, Opera 11+
Since : version 3.0
:hover - Subtle hover highlight and box shadow
:active - Inset box shadow and 1px offset
.disabled - Dims the button to indicate it cannot be used
*/
.button,
input[type=submit],
input.button,
button,
a.button {
position:relative;
font-family: Helvetica, Arial, Geneva, , sans-serif;
font-size:100%;
display: inline-block;
zoom: 1; /* zoom and *display = ie7 hack for display:inline-block */
*display: inline;
vertical-align: baseline;
margin:0;
outline: none;
cursor: pointer;
text-align: center;
text-decoration: none;
padding:.3125em .625em; /* 5/10px when base is 16px */
font-weight:bold;
-webkit-border-radius: 3px;
-moz-border-radius:3px;
border-radius:3px;
min-width:6em;
font-weight:bold;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
-webkit-border-radius: .25em;
-moz-border-radius: .25em;
border-radius: .25em;
color:#333;
border:1px solid #CCC;
background-color: #f5f5f5;
background-image: -moz-linear-gradient(top, #fafafa, #ededed);
background-image: -ms-linear-gradient(top, #fafafa, #ededed);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fafafa), to(#ededed));
background-image: -webkit-linear-gradient(top, #fafafa, #ededed);
background-image: -o-linear-gradient(top, #fafafa, #ededed);
background-image: linear-gradient(top, #fafafa, #ededed);
}
/* primary buttons are orange */
.button.primary,
input[type=submit].primary,
input.button.primary,
button.pimary,
a.button.primary {
color:#fff;
text-shadow: 0 0 2px #9a9a9a;
background: #f99713; /* Old browsers */
background: -moz-linear-gradient(top, #f99713 0%, #e56b2b 57%, #ededed 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f99713), color-stop(57%,#e56b2b), color-stop(100%,#e56b2b)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #f99713 0%,#e56b2b 57%,#e56b2b 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #f99713 0%,#e56b2b 57%,#e56b2b 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #f99713 0%,#e56b2b 57%,#e56b2b 100%); /* IE10+ */
background: linear-gradient(to bottom, #f99713 0%,#e56b2b 57%,#e56b2b 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f99713', endColorstr='#e56b2b',GradientType=0 ); /* IE6-9 */
border:1px solid #f06818;
}
/* size and position adjustments */
.submit {
display: inline-block; /* in case there is a div wrapper */
}
/* hover */
.button:hover,
input[type=submit]:hover,
input.button:hover,
button:hover,
a.button:hover,
.button:focus,
input[type=submit]:focus,
input.button:focus,
button:focus,
a.button:focus {
text-decoration: none;
-webkit-box-shadow: 0 1px 2px rgba(255,255,255,.2);
-moz-box-shadow: 0 1px 2px rgba(0,0,0,.2);
box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
/* active */
.button:active,
input[type=submit]:active,
input.button:active,
button:active,
a.button:active {
position: relative;
top: 1px;
-webkit-box-shadow: inset 0 1px 2px rgba(255,255,255,.2);
-moz-box-shadow: inset 0 1px 2px rgba(0,0,0,.2);
box-shadow: inset 0 1px 2px rgba(0,0,0,.2);
}
.button.disabled,
input[type=submit].disabled,
input.button.disabled,
button.disabled,
a.button.disabled {
cursor:default;
color:#888;
background:white;
}
/* inactive */
.button.disabled:hover,
.button.disabled:active,
input[type=submit].disabled:hover,
input.button.disabled:hover,
button.disabled:hover,
a.button.disabled:hover,
input[type=submit].disabled:active,
input.button.disabled:active,
button.disabled:active,
a.button.disabled:active {
-webkit-box-shadow:0 0 0;
-moz-box-shadow:0 0 0;
box-shadow:0 0 0;
top:0;
border:1px solid #CCC;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment