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

185 lines
3.4 KiB
SCSS
Raw Normal View History

2013-02-06 03:16:51 +08:00
// --------------------------------------------------
// Buttons
// --------------------------------------------------
// Base
// --------------------------------------------------
2013-02-06 03:16:51 +08:00
.btn {
display: inline-block;
margin: 0;
padding: 6px 12px;
font-weight: 500;
font-size: 1em;
2013-02-06 03:16:51 +08:00
line-height: 18px;
text-align: center;
cursor: pointer;
2014-08-06 21:31:13 +08:00
transition: all .25s;
2013-02-06 03:16:51 +08:00
&:active {
text-shadow: none;
}
&[disabled], &.disabled {
2013-02-06 03:16:51 +08:00
cursor: default;
opacity: 0.4;
}
2013-12-10 05:27:49 +08:00
.fa {
2013-02-06 03:16:51 +08:00
margin-right: 7px;
}
&.no-text {
2013-12-10 05:27:49 +08:00
.fa {
margin-right: 0;
line-height: 10px;
}
}
2013-02-06 03:16:51 +08:00
}
.btn.hidden {
display: none;
}
2013-02-06 03:16:51 +08:00
// Default button
// --------------------------------------------------
.btn {
2013-10-29 00:25:52 +08:00
border: none;
color: $primary;
2013-10-29 00:25:52 +08:00
font-weight: normal;
2014-08-06 21:31:13 +08:00
background: dark-light-diff($primary, $secondary, 90%, -65%);
2013-02-06 03:16:51 +08:00
&[href] {
color: $primary;
2013-02-06 03:16:51 +08:00
}
&:hover {
2014-08-06 21:31:13 +08:00
background: dark-light-diff($primary, $secondary, 65%, -75%);
2016-03-31 00:05:16 +08:00
color: $secondary;
2013-02-06 03:16:51 +08:00
}
&[disabled], &.disabled {
background: dark-light-diff($primary, $secondary, 90%, -60%);
&:hover { color: dark-light-choose(scale-color($primary, $lightness: 70%), scale-color($secondary, $lightness: 30%)); }
cursor: not-allowed;
2013-02-06 03:16:51 +08:00
}
}
// Primary button
// --------------------------------------------------
.btn-primary {
2013-10-29 00:25:52 +08:00
border: none;
font-weight: normal;
2015-08-19 04:20:07 +08:00
color: dark-light-choose(#fff, scale-color($primary, $lightness: 60%));
background: $tertiary;
2013-10-29 00:25:52 +08:00
2013-02-06 03:16:51 +08:00
&[href] {
color: $secondary;
2013-02-06 03:16:51 +08:00
}
&:hover {
color: #fff;
background: dark-light-choose(scale-color($tertiary, $lightness: -20%), scale-color($tertiary, $lightness: -20%));
2013-02-06 03:16:51 +08:00
}
&:active {
@include linear-gradient(scale-color($tertiary, $lightness: -20%), scale-color($tertiary, $lightness: -10%));
2016-03-31 00:05:16 +08:00
color: $secondary;
2013-02-06 03:16:51 +08:00
}
&[disabled], &.disabled {
background: $tertiary;
2013-02-06 03:16:51 +08:00
}
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: $secondary;
font-weight: normal;
background: $danger;
2013-02-14 15:56:13 +08:00
&[href] {
color: $secondary;
2013-02-14 15:56:13 +08:00
}
&:hover{
background: scale-color($danger, $lightness: -20%);
2013-02-14 15:56:13 +08:00
}
&:active {
@include linear-gradient(scale-color($danger, $lightness: -20%), $danger);
2013-02-14 15:56:13 +08:00
}
&[disabled], &.disabled {
background: $danger;
2013-02-14 15:56:13 +08:00
}
2013-02-06 03:16:51 +08:00
}
// 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);
2013-02-06 03:16:51 +08:00
&[href] {
color: $secondary;
2013-02-06 03:16:51 +08:00
}
&:before {
margin-right: 9px;
font-family: FontAwesome;
font-size: 17px;
2013-02-06 03:16:51 +08:00
}
&.google, &.google_oauth2 {
2013-02-06 03:16:51 +08:00
background: $google;
&:before {
content: $fa-var-google;
2013-02-06 03:16:51 +08:00
}
}
2016-02-25 09:21:59 +08:00
&.instagram {
background: $instagram;
&:before {
content: $fa-var-instagram;
}
}
2013-02-06 03:16:51 +08:00
&.facebook {
background: $facebook;
&:before {
content: $fa-var-facebook;
2013-02-06 03:16:51 +08:00
}
}
2013-05-24 04:40:50 +08:00
&.cas {
background: $cas;
}
2013-02-06 03:16:51 +08:00
&.twitter {
background: $twitter;
&:before {
content: $fa-var-twitter;
2013-02-06 03:16:51 +08:00
}
}
&.yahoo {
background: $yahoo;
&:before {
content: $fa-var-yahoo;
2013-02-06 03:16:51 +08:00
}
}
&.github {
background: $github;
&:before {
content: $fa-var-github;
}
}
2013-02-06 03:16:51 +08:00
}
// Button Sizes
// --------------------------------------------------
// Small
.btn-small {
padding: 3px 6px;
font-size: 0.857em;
2013-02-06 03:16:51 +08:00
line-height: 16px;
}
// Large
.btn-large {
padding: 9px 18px;
font-size: 1.143em;
2013-02-06 03:16:51 +08:00
line-height: 20px;
2013-02-14 15:56:13 +08:00
}