2013-02-06 03:16:51 +08:00
|
|
|
// --------------------------------------------------
|
|
|
|
// Buttons
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
// Base
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
2019-12-14 03:09:48 +08:00
|
|
|
@mixin btn(
|
2020-08-04 10:57:10 +08:00
|
|
|
$text-color: var(--primary),
|
|
|
|
$bg-color: var(--primary-low),
|
|
|
|
$icon-color: var(--primary-high),
|
|
|
|
$hover-text-color: var(--secondary),
|
|
|
|
$hover-bg-color: var(--primary-medium),
|
|
|
|
$hover-icon-color: var(--primary-low)
|
2019-12-14 03:09:48 +08:00
|
|
|
) {
|
2021-01-28 05:17:08 +08:00
|
|
|
box-sizing: border-box;
|
|
|
|
display: inline-flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
2013-02-06 03:16:51 +08:00
|
|
|
margin: 0;
|
2021-01-28 05:17:08 +08:00
|
|
|
padding: 0.53em 0.8em;
|
2019-12-14 03:09:48 +08:00
|
|
|
border: none;
|
|
|
|
font-weight: normal;
|
2021-01-28 05:17:08 +08:00
|
|
|
font-size: $font-0;
|
|
|
|
line-height: normal;
|
2019-12-14 03:09:48 +08:00
|
|
|
color: $text-color;
|
|
|
|
background: $bg-color;
|
2013-02-06 03:16:51 +08:00
|
|
|
cursor: pointer;
|
2018-06-08 17:49:31 +08:00
|
|
|
transition: all 0.25s;
|
2019-02-01 02:59:49 +08:00
|
|
|
.d-icon {
|
2019-12-14 03:09:48 +08:00
|
|
|
color: $icon-color;
|
|
|
|
margin-right: 0.45em;
|
2019-02-01 02:59:49 +08:00
|
|
|
transition: color 0.25s;
|
2013-02-06 03:16:51 +08:00
|
|
|
}
|
2013-05-08 02:25:41 +08:00
|
|
|
&.no-text {
|
2019-07-22 22:31:21 +08:00
|
|
|
.d-icon {
|
2013-05-08 02:25:41 +08:00
|
|
|
margin-right: 0;
|
|
|
|
}
|
|
|
|
}
|
2019-10-29 04:04:29 +08:00
|
|
|
@include hover {
|
2019-12-14 03:09:48 +08:00
|
|
|
background: $hover-bg-color;
|
|
|
|
color: $hover-text-color;
|
2019-10-29 04:04:29 +08:00
|
|
|
.d-icon {
|
2019-12-14 03:09:48 +08:00
|
|
|
color: $hover-icon-color;
|
2018-10-05 05:15:37 +08:00
|
|
|
}
|
2013-02-06 03:16:51 +08:00
|
|
|
}
|
2021-02-04 00:45:54 +08:00
|
|
|
&:focus {
|
|
|
|
outline: none;
|
|
|
|
background: $hover-bg-color;
|
|
|
|
color: $hover-text-color;
|
|
|
|
.d-icon {
|
|
|
|
color: $hover-icon-color;
|
|
|
|
}
|
|
|
|
}
|
2019-12-14 03:09:48 +08:00
|
|
|
&[href] {
|
|
|
|
color: $text-color;
|
|
|
|
}
|
|
|
|
&:active,
|
|
|
|
&.btn-active {
|
2020-07-29 06:21:53 +08:00
|
|
|
@include linear-gradient($hover-bg-color 0%, $bg-color 100%);
|
2019-12-14 03:09:48 +08:00
|
|
|
}
|
2018-06-08 17:49:31 +08:00
|
|
|
&[disabled],
|
|
|
|
&.disabled {
|
2019-12-14 03:09:48 +08:00
|
|
|
opacity: 0.4;
|
2018-06-08 17:49:31 +08:00
|
|
|
&:hover {
|
2019-12-14 03:09:48 +08:00
|
|
|
color: $text-color;
|
|
|
|
background: $bg-color;
|
2019-02-01 02:59:49 +08:00
|
|
|
.d-icon {
|
2019-12-14 03:09:48 +08:00
|
|
|
color: $icon-color;
|
2019-02-01 02:59:49 +08:00
|
|
|
}
|
2018-06-08 17:49:31 +08:00
|
|
|
}
|
2014-02-13 12:06:49 +08:00
|
|
|
cursor: not-allowed;
|
2013-02-06 03:16:51 +08:00
|
|
|
}
|
2020-03-31 05:17:00 +08:00
|
|
|
|
|
|
|
.loading-container {
|
|
|
|
display: none;
|
|
|
|
margin: 0 6.75px 0 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.is-loading {
|
|
|
|
&.btn-text {
|
|
|
|
.d-button-label {
|
|
|
|
font-size: $font-down-2;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.btn-small {
|
|
|
|
.loading-icon {
|
|
|
|
font-size: $font-down-1;
|
|
|
|
margin-right: 0.2em;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.loading-icon {
|
|
|
|
-webkit-animation: rotate-forever 1s infinite linear, fadein 1s;
|
|
|
|
animation: rotate-forever 1s infinite linear, fadein 1s;
|
|
|
|
}
|
|
|
|
}
|
2019-12-14 03:09:48 +08:00
|
|
|
}
|
2017-05-12 02:47:08 +08:00
|
|
|
|
2019-12-14 03:09:48 +08:00
|
|
|
.btn.hidden {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Default button
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
.btn {
|
|
|
|
@include btn;
|
2013-02-06 03:16:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// Primary button
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
.btn-primary {
|
2019-12-14 03:09:48 +08:00
|
|
|
@include btn(
|
2020-08-04 10:57:10 +08:00
|
|
|
$text-color: var(--secondary),
|
|
|
|
$bg-color: var(--tertiary),
|
|
|
|
$icon-color: var(--secondary),
|
|
|
|
$hover-bg-color: var(--tertiary-hover),
|
|
|
|
$hover-icon-color: var(--secondary)
|
2019-12-14 03:09:48 +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 {
|
2019-12-14 03:09:48 +08:00
|
|
|
@include btn(
|
2020-08-04 10:57:10 +08:00
|
|
|
$text-color: var(--secondary),
|
|
|
|
$bg-color: var(--danger),
|
|
|
|
$icon-color: var(--danger-low),
|
|
|
|
$hover-bg-color: var(--danger-hover),
|
|
|
|
$hover-icon-color: var(--danger-low)
|
2019-12-14 03:09:48 +08:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
// ✘ and ✔ buttons
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
.btn.cancel {
|
|
|
|
@include btn(
|
2020-08-04 10:57:10 +08:00
|
|
|
$text-color: var(--secondary),
|
|
|
|
$bg-color: var(--danger),
|
|
|
|
$icon-color: var(--secondary),
|
|
|
|
$hover-bg-color: var(--danger-hover),
|
|
|
|
$hover-icon-color: var(--secondary)
|
2019-12-14 03:09:48 +08:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
.btn.ok {
|
|
|
|
@include btn(
|
2020-08-04 10:57:10 +08:00
|
|
|
$text-color: var(--secondary),
|
|
|
|
$bg-color: var(--success),
|
|
|
|
$icon-color: var(--secondary),
|
|
|
|
$hover-bg-color: var(--success-hover),
|
|
|
|
$hover-icon-color: var(--secondary)
|
2019-12-14 03:09:48 +08:00
|
|
|
);
|
2013-02-06 03:16:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// Social buttons
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
2021-03-31 02:16:50 +08:00
|
|
|
.btn-social {
|
2021-02-11 04:53:18 +08:00
|
|
|
color: #000;
|
2021-03-31 02:16:50 +08:00
|
|
|
background: #fff;
|
2021-02-11 04:53:18 +08:00
|
|
|
border: 1px solid transparent;
|
2021-03-31 02:16:50 +08:00
|
|
|
&:hover,
|
|
|
|
&:focus {
|
|
|
|
box-shadow: shadow("card");
|
|
|
|
outline: 1px solid #000;
|
2018-01-23 10:19:38 +08:00
|
|
|
}
|
2013-02-06 03:16:51 +08:00
|
|
|
&[href] {
|
2020-08-04 10:57:10 +08:00
|
|
|
color: var(--secondary);
|
2013-02-06 03:16:51 +08:00
|
|
|
}
|
|
|
|
&:before {
|
2015-07-21 13:46:33 +08:00
|
|
|
margin-right: 9px;
|
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_oauth2 {
|
2020-08-04 10:57:10 +08:00
|
|
|
background: var(--google);
|
2018-10-25 10:11:19 +08:00
|
|
|
color: #333;
|
2018-11-27 05:49:57 +08:00
|
|
|
// non-FA SVG icon for Google in login-buttons.hbs
|
|
|
|
.d-icon {
|
|
|
|
opacity: 0.9;
|
2013-02-06 03:16:51 +08:00
|
|
|
}
|
2021-02-04 00:45:54 +08:00
|
|
|
&:hover,
|
|
|
|
&:focus {
|
2019-03-16 05:20:52 +08:00
|
|
|
color: currentColor;
|
|
|
|
}
|
2013-02-06 03:16:51 +08:00
|
|
|
}
|
2021-02-11 04:53:18 +08:00
|
|
|
|
2013-02-06 03:16:51 +08:00
|
|
|
&.facebook {
|
2021-02-11 04:53:18 +08:00
|
|
|
.d-icon {
|
|
|
|
color: $facebook;
|
|
|
|
}
|
|
|
|
&:hover {
|
|
|
|
.d-icon {
|
|
|
|
color: $facebook;
|
|
|
|
}
|
2019-03-16 05:20:52 +08:00
|
|
|
}
|
2013-02-06 03:16:51 +08:00
|
|
|
}
|
2013-05-24 04:40:50 +08:00
|
|
|
&.cas {
|
2021-02-11 04:53:18 +08:00
|
|
|
.d-icon {
|
|
|
|
color: var(--cas);
|
|
|
|
}
|
|
|
|
&:hover {
|
|
|
|
.d-icon {
|
|
|
|
color: var(--cas);
|
|
|
|
}
|
|
|
|
}
|
2013-05-24 04:40:50 +08:00
|
|
|
}
|
2013-02-06 03:16:51 +08:00
|
|
|
&.twitter {
|
2021-02-11 04:53:18 +08:00
|
|
|
.d-icon {
|
|
|
|
color: var(--twitter);
|
|
|
|
}
|
|
|
|
&:hover {
|
|
|
|
.d-icon {
|
|
|
|
color: var(--twitter);
|
|
|
|
}
|
2019-03-16 05:20:52 +08:00
|
|
|
}
|
2013-02-06 03:16:51 +08:00
|
|
|
}
|
2013-02-26 12:28:32 +08:00
|
|
|
&.github {
|
2021-02-11 04:53:18 +08:00
|
|
|
.d-icon {
|
|
|
|
color: var(--github);
|
|
|
|
}
|
|
|
|
&:hover {
|
|
|
|
.d-icon {
|
|
|
|
color: var(--github);
|
|
|
|
}
|
2019-03-16 05:20:52 +08:00
|
|
|
}
|
2013-02-26 12:28:32 +08:00
|
|
|
}
|
2019-08-30 17:54:19 +08:00
|
|
|
&.discord {
|
2021-02-11 04:53:18 +08:00
|
|
|
.d-icon {
|
|
|
|
color: var(--discord);
|
|
|
|
}
|
|
|
|
&:hover {
|
|
|
|
.d-icon {
|
|
|
|
color: var(--discord);
|
|
|
|
}
|
2019-08-30 17:54:19 +08:00
|
|
|
}
|
|
|
|
}
|
2013-02-06 03:16:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// Button Sizes
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
// Small
|
|
|
|
|
|
|
|
.btn-small {
|
2020-02-20 01:38:46 +08:00
|
|
|
padding: 6px;
|
2018-01-13 06:27:38 +08:00
|
|
|
font-size: $font-down-1;
|
2020-02-20 01:38:46 +08:00
|
|
|
min-height: 20px;
|
2020-02-25 02:18:46 +08:00
|
|
|
.d-icon {
|
|
|
|
max-height: 0.87em;
|
|
|
|
}
|
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
|
|
|
|
2021-04-08 04:15:07 +08:00
|
|
|
// Bonus Buttons
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
2017-07-25 05:31:14 +08:00
|
|
|
.btn-flat {
|
|
|
|
background: transparent;
|
|
|
|
border: 0;
|
2018-01-13 06:27:38 +08:00
|
|
|
line-height: $line-height-small;
|
2019-02-01 03:06:32 +08:00
|
|
|
transition: color 0.25s, background 0.25s;
|
2017-07-28 03:03:41 +08:00
|
|
|
.d-icon {
|
2020-08-04 10:57:10 +08:00
|
|
|
color: var(--primary-low-mid);
|
2019-02-01 02:59:49 +08:00
|
|
|
}
|
2019-10-29 04:04:29 +08:00
|
|
|
@include hover {
|
|
|
|
.d-icon {
|
2020-08-04 10:57:10 +08:00
|
|
|
color: var(--primary);
|
2019-10-29 04:04:29 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
&.close {
|
|
|
|
padding: 0;
|
|
|
|
min-height: unset;
|
|
|
|
background: transparent;
|
|
|
|
font-size: $font-up-3;
|
|
|
|
.d-icon {
|
2020-08-04 10:57:10 +08:00
|
|
|
color: var(--primary-high);
|
2019-10-29 04:04:29 +08:00
|
|
|
}
|
|
|
|
@include hover {
|
|
|
|
background: transparent;
|
2019-02-01 04:13:22 +08:00
|
|
|
.d-icon {
|
2020-08-04 10:57:10 +08:00
|
|
|
color: var(--primary);
|
2019-02-01 04:13:22 +08:00
|
|
|
}
|
2019-02-01 02:59:49 +08:00
|
|
|
}
|
2017-07-25 23:37:32 +08:00
|
|
|
}
|
2021-03-18 20:29:27 +08:00
|
|
|
|
|
|
|
&:focus {
|
|
|
|
outline: none;
|
|
|
|
background: var(--primary-medium);
|
|
|
|
color: var(--secondary);
|
|
|
|
.d-icon {
|
|
|
|
color: var(--primary-low);
|
|
|
|
}
|
|
|
|
}
|
2017-07-25 05:31:14 +08:00
|
|
|
}
|
2019-11-01 03:36:24 +08:00
|
|
|
|
|
|
|
.btn-link {
|
|
|
|
background: transparent;
|
|
|
|
border: 0;
|
|
|
|
padding: 0;
|
2020-08-04 10:57:10 +08:00
|
|
|
color: var(--tertiary);
|
2019-11-01 03:36:24 +08:00
|
|
|
}
|
2021-04-08 04:15:07 +08:00
|
|
|
|
|
|
|
.btn-mini-toggle {
|
|
|
|
padding: 0.4em 0.467em;
|
|
|
|
.d-icon {
|
|
|
|
color: var(--primary-high);
|
|
|
|
}
|
|
|
|
@include hover {
|
|
|
|
background: transparent;
|
|
|
|
.d-icon {
|
|
|
|
color: var(--primary);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
&:focus {
|
|
|
|
background: var(--primary-low);
|
|
|
|
.d-icon {
|
|
|
|
color: var(--primary);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|