2013-02-06 03:16:51 +08:00
|
|
|
// --------------------------------------------------
|
|
|
|
// Buttons
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
// Base
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
.btn {
|
|
|
|
display: inline-block;
|
|
|
|
margin: 0;
|
|
|
|
padding: 6px 12px;
|
|
|
|
font-weight: 500;
|
2018-01-13 06:27:38 +08:00
|
|
|
font-size: $font-0;
|
2018-09-19 20:37:04 +08:00
|
|
|
line-height: $line-height-small;
|
2013-02-06 03:16:51 +08:00
|
|
|
text-align: center;
|
|
|
|
cursor: pointer;
|
2018-06-08 17:49:31 +08:00
|
|
|
transition: all 0.25s;
|
2018-09-19 20:37:04 +08:00
|
|
|
box-sizing: border-box;
|
2018-09-19 21:08:03 +08:00
|
|
|
min-height: 30px;
|
2014-08-06 21:31:13 +08:00
|
|
|
|
2018-06-08 17:49:31 +08:00
|
|
|
&:active,
|
|
|
|
&.btn-active {
|
2013-02-06 03:16:51 +08:00
|
|
|
text-shadow: none;
|
|
|
|
}
|
2018-06-08 17:49:31 +08:00
|
|
|
&[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;
|
|
|
|
}
|
2013-05-08 02:25:41 +08:00
|
|
|
&.no-text {
|
2013-12-10 05:27:49 +08:00
|
|
|
.fa {
|
2013-05-08 02:25:41 +08:00
|
|
|
margin-right: 0;
|
|
|
|
}
|
|
|
|
}
|
2013-02-06 03:16:51 +08:00
|
|
|
}
|
|
|
|
|
2014-07-26 05:08:54 +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;
|
2014-05-06 13:50:51 +08:00
|
|
|
color: $primary;
|
2013-10-29 00:25:52 +08:00
|
|
|
font-weight: normal;
|
2018-06-08 17:49:31 +08:00
|
|
|
background: $primary-low;
|
2014-02-13 12:06:49 +08:00
|
|
|
|
2013-02-06 03:16:51 +08:00
|
|
|
&[href] {
|
2014-05-06 13:50:51 +08:00
|
|
|
color: $primary;
|
2018-09-19 20:37:04 +08:00
|
|
|
min-height: unset; // ovverides button defaults
|
2013-02-06 03:16:51 +08:00
|
|
|
}
|
2018-10-05 05:15:37 +08:00
|
|
|
.discourse-no-touch & {
|
|
|
|
// only allow hover on no-touch devices
|
|
|
|
&:hover,
|
|
|
|
&.btn-hover {
|
|
|
|
background: $primary-medium;
|
|
|
|
color: $secondary;
|
|
|
|
}
|
2013-02-06 03:16:51 +08:00
|
|
|
}
|
2018-06-08 17:49:31 +08:00
|
|
|
&[disabled],
|
|
|
|
&.disabled {
|
|
|
|
background: $primary-low;
|
|
|
|
&:hover {
|
|
|
|
color: dark-light-choose($primary-low-mid, $secondary-high);
|
|
|
|
}
|
2014-02-13 12:06:49 +08:00
|
|
|
cursor: not-allowed;
|
2013-02-06 03:16:51 +08:00
|
|
|
}
|
2017-05-12 02:47:08 +08:00
|
|
|
|
2017-07-28 03:03:41 +08:00
|
|
|
.d-icon {
|
2017-05-12 02:47:08 +08:00
|
|
|
opacity: 0.7;
|
2018-06-08 17:49:31 +08:00
|
|
|
line-height: $line-height-medium; // Match button text line-height
|
2017-05-12 02:47:08 +08:00
|
|
|
}
|
2017-07-28 03:03:41 +08:00
|
|
|
&.btn-primary .d-icon {
|
2017-05-13 03:11:44 +08:00
|
|
|
opacity: 1;
|
|
|
|
}
|
2013-02-06 03:16:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// Primary button
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
.btn-primary {
|
2013-10-29 00:25:52 +08:00
|
|
|
border: none;
|
2013-10-29 01:46:59 +08:00
|
|
|
font-weight: normal;
|
2017-11-28 07:30:12 +08:00
|
|
|
color: $secondary;
|
2015-08-19 04:20:07 +08:00
|
|
|
background: $tertiary;
|
2013-10-29 00:25:52 +08:00
|
|
|
|
2013-02-06 03:16:51 +08:00
|
|
|
&[href] {
|
2014-05-06 13:50:51 +08:00
|
|
|
color: $secondary;
|
2013-02-06 03:16:51 +08:00
|
|
|
}
|
2018-10-05 05:15:37 +08:00
|
|
|
.discourse-no-touch & {
|
|
|
|
// only allow hover on no-touch devices
|
|
|
|
&:hover,
|
|
|
|
&.btn-hover {
|
|
|
|
background: dark-light-choose(
|
|
|
|
scale-color($tertiary, $lightness: -20%),
|
|
|
|
scale-color($tertiary, $lightness: 20%)
|
|
|
|
);
|
|
|
|
}
|
2013-02-06 03:16:51 +08:00
|
|
|
}
|
2018-06-08 17:49:31 +08:00
|
|
|
&:active,
|
|
|
|
&.btn-active {
|
2018-08-31 18:14:41 +08:00
|
|
|
@include linear-gradient(
|
|
|
|
scale-color($tertiary, $lightness: -20%),
|
|
|
|
$tertiary
|
|
|
|
);
|
2013-02-06 03:16:51 +08:00
|
|
|
}
|
2018-06-08 17:49:31 +08:00
|
|
|
&[disabled],
|
|
|
|
&.disabled {
|
2014-05-06 13:50:51 +08:00
|
|
|
background: $tertiary;
|
2013-02-06 03:16:51 +08:00
|
|
|
}
|
2013-02-14 15:56:13 +08:00
|
|
|
}
|
2013-02-14 15:47:19 +08:00
|
|
|
|
2013-02-14 15:56:13 +08:00
|
|
|
// Danger button
|
|
|
|
// --------------------------------------------------
|
2013-02-14 15:47:19 +08:00
|
|
|
|
2013-02-14 15:56:13 +08:00
|
|
|
.btn-danger {
|
2014-05-06 13:50:51 +08:00
|
|
|
color: $secondary;
|
2013-10-29 01:46:59 +08:00
|
|
|
font-weight: normal;
|
2014-05-06 13:50:51 +08:00
|
|
|
background: $danger;
|
2013-02-14 15:56:13 +08:00
|
|
|
&[href] {
|
2014-05-06 13:50:51 +08:00
|
|
|
color: $secondary;
|
2013-02-14 15:56:13 +08:00
|
|
|
}
|
2018-10-05 05:15:37 +08:00
|
|
|
.discourse-no-touch & {
|
|
|
|
// only allow hover on no-touch devices
|
|
|
|
&:hover,
|
|
|
|
&.btn-hover {
|
|
|
|
background: dark-light-choose(
|
|
|
|
scale-color($danger, $lightness: -20%),
|
|
|
|
scale-color($danger, $lightness: 20%)
|
|
|
|
);
|
|
|
|
}
|
2013-02-14 15:56:13 +08:00
|
|
|
}
|
2018-06-08 17:49:31 +08:00
|
|
|
&:active,
|
|
|
|
&.btn-active {
|
2014-05-06 13:50:51 +08:00
|
|
|
@include linear-gradient(scale-color($danger, $lightness: -20%), $danger);
|
2013-02-14 15:56:13 +08:00
|
|
|
}
|
2018-06-08 17:49:31 +08:00
|
|
|
&[disabled],
|
|
|
|
&.disabled {
|
2014-05-06 13:50:51 +08:00
|
|
|
background: $danger;
|
2013-02-14 15:56:13 +08:00
|
|
|
}
|
2013-02-06 03:16:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// Social buttons
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
.btn-social {
|
2018-01-23 10:19:38 +08:00
|
|
|
color: #fff;
|
|
|
|
&:hover {
|
|
|
|
color: #fff;
|
|
|
|
}
|
2013-02-06 03:16:51 +08:00
|
|
|
&[href] {
|
2014-05-06 13:50:51 +08:00
|
|
|
color: $secondary;
|
2013-02-06 03:16:51 +08:00
|
|
|
}
|
|
|
|
&:before {
|
2015-07-21 13:46:33 +08:00
|
|
|
margin-right: 9px;
|
2018-11-08 13:12:18 +08:00
|
|
|
font-family: FontAwesome;
|
2018-02-20 20:29:43 +08:00
|
|
|
font-size: $font-0;
|
2013-02-06 03:16:51 +08:00
|
|
|
}
|
2018-06-08 17:49:31 +08:00
|
|
|
&.google,
|
|
|
|
&.google_oauth2 {
|
2013-02-06 03:16:51 +08:00
|
|
|
background: $google;
|
2018-10-25 10:11:19 +08:00
|
|
|
color: #333;
|
|
|
|
border: 1px solid $primary-low;
|
2018-11-08 13:12:18 +08:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
&:before {
|
|
|
|
content: "";
|
|
|
|
display: inline-block;
|
|
|
|
width: 15px;
|
|
|
|
height: 15px;
|
|
|
|
// Background image url needs to be encoded for IE11
|
|
|
|
background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20viewBox%3D%220%200%2048%2048%22%3E%3Cdefs%3E%3Cpath%20id%3D%22a%22%20d%3D%22M44.5%2020H24v8.5h11.8C34.7%2033.9%2030.1%2037%2024%2037c-7.2%200-13-5.8-13-13s5.8-13%2013-13c3.1%200%205.9%201.1%208.1%202.9l6.4-6.4C34.6%204.1%2029.6%202%2024%202%2011.8%202%202%2011.8%202%2024s9.8%2022%2022%2022c11%200%2021-8%2021-22%200-1.3-.2-2.7-.5-4z%22%2F%3E%3C%2Fdefs%3E%3CclipPath%20id%3D%22b%22%3E%3Cuse%20xlink%3Ahref%3D%22%23a%22%20overflow%3D%22visible%22%2F%3E%3C%2FclipPath%3E%3Cpath%20clip-path%3D%22url(%23b)%22%20fill%3D%22%23FBBC05%22%20d%3D%22M0%2037V11l17%2013z%22%2F%3E%3Cpath%20clip-path%3D%22url(%23b)%22%20fill%3D%22%23EA4335%22%20d%3D%22M0%2011l17%2013%207-6.1L48%2014V0H0z%22%2F%3E%3Cpath%20clip-path%3D%22url(%23b)%22%20fill%3D%22%2334A853%22%20d%3D%22M0%2037l30-23%207.9%201L48%200v48H0z%22%2F%3E%3Cpath%20clip-path%3D%22url(%23b)%22%20fill%3D%22%234285F4%22%20d%3D%22M48%2048L17%2024l-4-3%2035-10z%22%2F%3E%3C%2Fsvg%3E");
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
background-size: cover;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.mobile-view & {
|
|
|
|
// Special case because we're using SVG here
|
|
|
|
&.google,
|
|
|
|
&.google_oauth2 {
|
|
|
|
&:before {
|
|
|
|
width: 17px;
|
|
|
|
height: 17px;
|
|
|
|
}
|
2013-02-06 03:16:51 +08:00
|
|
|
}
|
|
|
|
}
|
2016-02-25 09:21:59 +08:00
|
|
|
&.instagram {
|
|
|
|
background: $instagram;
|
2018-11-08 13:12:18 +08:00
|
|
|
&:before {
|
|
|
|
content: $fa-var-instagram;
|
|
|
|
}
|
2016-02-25 09:21:59 +08:00
|
|
|
}
|
2013-02-06 03:16:51 +08:00
|
|
|
&.facebook {
|
|
|
|
background: $facebook;
|
2018-11-08 13:12:18 +08:00
|
|
|
&: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;
|
2018-11-08 13:12:18 +08:00
|
|
|
&:before {
|
|
|
|
content: $fa-var-twitter;
|
|
|
|
}
|
2013-02-06 03:16:51 +08:00
|
|
|
}
|
|
|
|
&.yahoo {
|
|
|
|
background: $yahoo;
|
2018-11-08 13:12:18 +08:00
|
|
|
&:before {
|
|
|
|
content: $fa-var-yahoo;
|
|
|
|
}
|
2013-02-06 03:16:51 +08:00
|
|
|
}
|
2013-02-26 12:28:32 +08:00
|
|
|
&.github {
|
|
|
|
background: $github;
|
2018-11-08 13:12:18 +08:00
|
|
|
&:before {
|
|
|
|
content: $fa-var-github;
|
|
|
|
}
|
2013-02-26 12:28:32 +08:00
|
|
|
}
|
2013-02-06 03:16:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// Button Sizes
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
// Small
|
|
|
|
|
|
|
|
.btn-small {
|
|
|
|
padding: 3px 6px;
|
2018-01-13 06:27:38 +08:00
|
|
|
font-size: $font-down-1;
|
2013-02-06 03:16:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// Large
|
|
|
|
|
|
|
|
.btn-large {
|
|
|
|
padding: 9px 18px;
|
2018-01-13 06:27:38 +08:00
|
|
|
font-size: $font-up-1;
|
|
|
|
line-height: $line-height-small;
|
2013-02-14 15:56:13 +08:00
|
|
|
}
|
2017-07-25 05:31:14 +08:00
|
|
|
|
|
|
|
.btn-flat {
|
|
|
|
background: transparent;
|
|
|
|
border: 0;
|
|
|
|
outline: 0;
|
2018-01-13 06:27:38 +08:00
|
|
|
line-height: $line-height-small;
|
2017-07-28 03:03:41 +08:00
|
|
|
.d-icon {
|
2017-07-25 23:37:32 +08:00
|
|
|
opacity: 0.7;
|
|
|
|
}
|
2017-07-25 05:31:14 +08:00
|
|
|
}
|