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