discourse/app/assets/stylesheets/common/components/buttons.css.scss

206 lines
3.7 KiB
SCSS
Raw Normal View History

@import "common/foundation/variables";
@import "common/foundation/mixins";
2013-02-06 03:16:51 +08:00
// --------------------------------------------------
// Buttons
// --------------------------------------------------
// Base
// --------------------------------------------------
button {
outline: 0;
}
2013-02-06 03:16:51 +08:00
.btn {
display: inline-block;
outline: 0;
margin: 0;
padding: 6px 12px;
font-weight: 500;
font-size: 14px;
line-height: 18px;
text-align: center;
cursor: pointer;
&:active {
text-shadow: none;
}
&[disabled], &.disabled {
2013-02-06 03:16:51 +08:00
cursor: default;
opacity: 0.4;
}
.icon {
margin-right: 7px;
}
&.no-text {
.icon {
margin-right: 0;
line-height: 10px;
}
}
2013-02-06 03:16:51 +08:00
}
// Default button
// --------------------------------------------------
.btn {
2013-10-29 00:25:52 +08:00
border: none;
color: #534d4b;
font-weight: normal;
background: #e8e8e8;
2013-02-06 03:16:51 +08:00
&[href] {
color: $btn-default-color;
}
&:hover
{
background: #aaa;
2013-10-29 00:25:52 +08:00
color: #fff;
2013-02-06 03:16:51 +08:00
}
&:active {
@include linear-gradient( darken(#aaa, 8%), #aaa);
@include box-shadow(inset 0 1px 3px rgba($black, 0.2));
2013-02-06 03:16:51 +08:00
}
&[disabled] {
@include linear-gradient($white, $btn-default-background-color);
@include box-shadow(inset 0 -1px 2px rgba($black, 0.2));
}
}
// Buttons used in admin panel
// --------------------------------------------------
.btn-admin {
text-align:left;
}
2013-02-06 03:16:51 +08:00
// Primary button
// --------------------------------------------------
.btn-primary {
2013-10-29 00:25:52 +08:00
border: none;
2013-02-06 03:16:51 +08:00
color: $white;
font-weight: normal;
2013-10-29 00:25:52 +08:00
color: #fff;
background: $btn-primary-background-color;
2013-10-29 00:25:52 +08:00
2013-02-06 03:16:51 +08:00
&[href] {
color: $white;
}
&:hover
{
color: #fff;
background: darken($btn-primary-background-color, 12%);
2013-02-06 03:16:51 +08:00
}
&:active {
@include linear-gradient(darken($btn-primary-background-color, 18%), darken($btn-primary-background-color, 12%));
2013-02-06 03:16:51 +08:00
@include box-shadow(inset 0 1px 3px rgba($black, 0.2));
color: #fff;
2013-02-06 03:16:51 +08:00
}
&[disabled] {
text-shadow: 0 1px 0 rgba($black, 0.2);
@include linear-gradient($btn-primary-background-color, $btn-primary-background-color-dark);
@include box-shadow((inset 0 1px 0 rgba($white, 0.33), inset 0 -1px 2px rgba($black, 0.2)));
}
2013-02-14 15:56:13 +08:00
}
2013-02-14 15:56:13 +08:00
// Danger button
// --------------------------------------------------
2013-02-14 15:56:13 +08:00
.btn-danger {
color: $white;
font-weight: normal;
background: $btn-danger-background-color;
2013-02-14 15:56:13 +08:00
&[href] {
color: $white;
2013-02-14 15:56:13 +08:00
}
&:hover{
background: $btn-danger-background-color-dark;
2013-02-14 15:56:13 +08:00
}
&:active {
@include linear-gradient($btn-primary-background-color-dark, $btn-primary-background-color);
2013-02-14 15:56:13 +08:00
@include box-shadow(inset 0 1px 3px rgba($black, 0.2));
}
&[disabled] {
2013-02-14 15:56:13 +08:00
}
2013-02-06 03:16:51 +08:00
}
// Social buttons
// --------------------------------------------------
.btn-social {
color: $white;
text-shadow: 0 1px 0 rgba($black, 0.2);
@include box-shadow(inset 0 1px 0 rgba($white, 0.1));
&[href] {
color: $white;
}
&:before {
margin-right: 7px;
font-family: zocial;
line-height: 0.9;
}
&.google {
background: $google;
&:before {
content: "G";
}
}
&.facebook {
background: $facebook;
&:before {
content: "f";
}
}
2013-05-24 04:40:50 +08:00
&.cas {
background: $cas;
}
2013-02-06 03:16:51 +08:00
&.twitter {
background: $twitter;
&:before {
content: "T";
}
}
&.yahoo {
background: $yahoo;
&:before {
content: "Y";
}
}
&.github {
background: $github;
&:before {
content: "g";
}
}
&.persona {
background: $persona;
&:before {
content: "]";
}
}
2013-02-06 03:16:51 +08:00
}
// 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;
2013-02-14 15:56:13 +08:00
}