discourse/app/assets/stylesheets/common/components/buttons.css.scss
2014-10-10 15:02:46 -07:00

186 lines
3.2 KiB
SCSS

// --------------------------------------------------
// Buttons
// --------------------------------------------------
// Base
// --------------------------------------------------
.btn {
display: inline-block;
margin: 0;
padding: 6px 12px;
font-weight: 500;
font-size: 14px;
line-height: 18px;
text-align: center;
cursor: pointer;
transition: all .25s;
&:active {
text-shadow: none;
}
&[disabled], &.disabled {
cursor: default;
opacity: 0.4;
}
.fa {
margin-right: 7px;
}
&.no-text {
.fa {
margin-right: 0;
line-height: 10px;
}
}
}
.btn.hidden {
display: none;
}
// Default button
// --------------------------------------------------
.btn {
border: none;
color: $primary;
font-weight: normal;
background: dark-light-diff($primary, $secondary, 90%, -65%);
&[href] {
color: $primary;
}
&:hover {
background: dark-light-diff($primary, $secondary, 65%, -75%);
color: #fff;
}
&:active {
}
&[disabled] {
background: scale-color-diff();
&:hover { color: scale-color($primary, $lightness: 70%); }
cursor: not-allowed;
}
}
// Buttons used in admin panel
// --------------------------------------------------
.btn-admin {
text-align:left;
}
// Primary button
// --------------------------------------------------
.btn-primary {
border: none;
color: $secondary;
font-weight: normal;
color: #fff;
background: $tertiary;
&[href] {
color: $secondary;
}
&:hover {
color: #fff;
background: scale-color($tertiary, $lightness: -20%);
}
&:active {
@include linear-gradient(scale-color($tertiary, $lightness: -20%), scale-color($tertiary, $lightness: -10%));
color: #fff;
}
&[disabled] {
background: $tertiary;
}
}
// Danger button
// --------------------------------------------------
.btn-danger {
color: $secondary;
font-weight: normal;
background: $danger;
&[href] {
color: $secondary;
}
&:hover{
background: scale-color($danger, $lightness: -20%);
}
&:active {
@include linear-gradient(scale-color($danger, $lightness: -20%), $danger);
}
&[disabled] {
background: $danger;
}
}
// Social buttons
// --------------------------------------------------
.btn-social {
color: $secondary;
text-shadow: 0 1px 0 rgba($primary, 0.2);
box-shadow: inset 0 1px 0 rgba(0,0,0, 0.1);
&[href] {
color: $secondary;
}
&:before {
margin-right: 7px;
font-family: zocial;
line-height: 0.9;
}
&.google, &.google_oauth2 {
background: $google;
&:before {
content: "G";
}
}
&.facebook {
background: $facebook;
&:before {
content: "f";
}
}
&.cas {
background: $cas;
}
&.twitter {
background: $twitter;
&:before {
content: "T";
}
}
&.yahoo {
background: $yahoo;
&:before {
content: "Y";
}
}
&.github {
background: $github;
&:before {
content: "g";
}
}
}
// Button Sizes
// --------------------------------------------------
// Small
.btn-small {
padding: 3px 6px;
font-size: 12px;
line-height: 16px;
}
// Large
.btn-large {
padding: 9px 18px;
font-size: 16px;
line-height: 20px;
}