331 lines
6.9 KiB
SCSS
331 lines
6.9 KiB
SCSS
//
|
|
// Buttons
|
|
//
|
|
// Base styles
|
|
// --------------------------------------------------
|
|
|
|
.btn {
|
|
background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214
|
|
background-color: $mediumgray-dark;
|
|
border: 1px solid $mediumgray-dark;
|
|
color: $white;
|
|
cursor: pointer;
|
|
display: inline-block;
|
|
margin-bottom: 0; // For input.btn
|
|
font-weight: $btn-font-weight;
|
|
text-align: center;
|
|
touch-action: manipulation;
|
|
user-select: none;
|
|
vertical-align: middle;
|
|
white-space: nowrap;
|
|
transition: all $transition-speed;
|
|
@include button-size($padding-base-vertical, $padding-base-horizontal, $font-size-base, $line-height-base, $btn-border-radius-base);
|
|
|
|
&,
|
|
&:active,
|
|
&.active {
|
|
&:focus,
|
|
&.focus {
|
|
@include tab-focus;
|
|
}
|
|
}
|
|
|
|
&:hover,
|
|
&:focus,
|
|
&.focus {
|
|
color: $white;
|
|
text-decoration: none;
|
|
}
|
|
|
|
&:active,
|
|
&.active {
|
|
outline: 0;
|
|
background-image: none;
|
|
box-shadow: inset 0 1px 2px rgba(0, 0, 0, .125);
|
|
}
|
|
|
|
&:hover,
|
|
&:focus,
|
|
&:active,
|
|
&.active {
|
|
color: $white;
|
|
border-color: #7c848e;
|
|
background-color: #7c848e;
|
|
outline: none !important;
|
|
}
|
|
|
|
&.disabled,
|
|
&[disabled],
|
|
fieldset[disabled] & {
|
|
border-color: $mediumgray-dark;
|
|
background-color: $mediumgray-dark;
|
|
cursor: $cursor-disabled;
|
|
opacity: .45;
|
|
box-shadow: none;
|
|
}
|
|
|
|
&.is-submitting-icon {
|
|
.bi {
|
|
color: transparent !important;
|
|
pointer-events: none !important;
|
|
position: relative !important;
|
|
|
|
&::after {
|
|
animation: submit-loader 1.25s infinite linear;
|
|
border: 2px solid white;
|
|
border-radius: 50%;
|
|
border-right-color: transparent;
|
|
content: "";
|
|
display: block;
|
|
position: absolute;
|
|
left: calc(50% - 7px);
|
|
top: calc(50% - 7px);
|
|
width: 14px;
|
|
height: 14px;
|
|
}
|
|
}
|
|
}
|
|
|
|
/* temporary */
|
|
&.bi {
|
|
line-height: 1.33;
|
|
}
|
|
|
|
.bi {
|
|
line-height: 1;
|
|
position: relative;
|
|
}
|
|
|
|
.bi-slash-circle,
|
|
.bi-arrow-left-right,
|
|
.bi-arrow-clockwise,
|
|
.bi-pencil-square,
|
|
.bi-search,
|
|
.bi-list-ul,
|
|
.bi-list-check,
|
|
.bi-funnel-fill,
|
|
.bi-braces,
|
|
.bi-trash,
|
|
.bi-x-lg {
|
|
top: 1px;
|
|
}
|
|
|
|
.bi-arrow-repeat,
|
|
.bi-braces {
|
|
margin-right: 10px;
|
|
}
|
|
}
|
|
|
|
.btn,
|
|
.badge {
|
|
&.is-submitting {
|
|
color: transparent !important;
|
|
pointer-events: none !important;
|
|
position: relative !important;
|
|
|
|
&::before {
|
|
animation: submit-loader 1.25s infinite linear;
|
|
border: 3px solid white;
|
|
border-radius: 50%;
|
|
border-right-color: transparent;
|
|
content: "";
|
|
display: block;
|
|
position: absolute;
|
|
left: calc(50% - 10px);
|
|
top: calc(50% - 10px);
|
|
width: 20px;
|
|
height: 20px;
|
|
}
|
|
}
|
|
}
|
|
|
|
a.btn {
|
|
&.disabled,
|
|
fieldset[disabled] & {
|
|
pointer-events: none; // Future-proof disabling of clicks on `<a>` elements
|
|
}
|
|
}
|
|
|
|
// Alternate buttons
|
|
// --------------------------------------------------
|
|
//@mixin button-variant($color, $background, $border)
|
|
|
|
.btn-default {
|
|
@include button-variant($btn-default-color, $btn-default-bg, $btn-default-border);
|
|
}
|
|
|
|
.btn-primary {
|
|
@include button-variant($btn-primary-color, $btn-primary-bg, $btn-primary-border);
|
|
}
|
|
|
|
.btn-secondary {
|
|
@include button-variant($btn-secondary-color, $btn-secondary-bg, $btn-secondary-border);
|
|
}
|
|
|
|
// Success appears as green
|
|
.btn-success {
|
|
@include button-variant($btn-success-color, $btn-success-bg, $btn-success-border);
|
|
}
|
|
|
|
// Info appears as blue-green
|
|
.btn-info {
|
|
@include button-variant($btn-info-color, $btn-info-bg, $btn-info-border);
|
|
}
|
|
|
|
// Warning appears as orange
|
|
.btn-warning {
|
|
@include button-variant($btn-warning-color, $btn-warning-bg, $btn-warning-border);
|
|
}
|
|
|
|
// Danger and error appear as red
|
|
.btn-danger {
|
|
@include button-variant($btn-danger-color, $btn-danger-bg, $btn-danger-border);
|
|
}
|
|
|
|
.btn-light {
|
|
@include button-variant(#252d38, #f1f2f6, #f1f2f6);
|
|
}
|
|
|
|
.btn-ghost {
|
|
@include button-variant($btn-ghost-color, $btn-ghost-bg, $btn-ghost-border);
|
|
|
|
@include haf {
|
|
background-color: $gray-background;
|
|
}
|
|
}
|
|
|
|
.btn-success-indeterminate {
|
|
@include button-variant($btn-success-color, $btn-success-bg, $btn-success-border);
|
|
|
|
opacity: .45;
|
|
}
|
|
|
|
.btn-danger-indeterminate {
|
|
@include button-variant($btn-danger-color, $btn-danger-bg, $btn-danger-border);
|
|
|
|
opacity: .45;
|
|
}
|
|
|
|
// Link buttons
|
|
// -------------------------
|
|
|
|
// Make a button look and behave like a link
|
|
.btn-link {
|
|
color: $btn-link-color;
|
|
font-weight: normal;
|
|
border-radius: 0;
|
|
border-color: transparent;
|
|
|
|
&,
|
|
&:active,
|
|
&.active,
|
|
&.disabled,
|
|
&[disabled],
|
|
fieldset[disabled] & {
|
|
border-color: transparent;
|
|
background-color: transparent;
|
|
box-shadow: none;
|
|
}
|
|
|
|
// &,
|
|
&:hover,
|
|
&:focus,
|
|
&:active {
|
|
border-color: transparent;
|
|
color: $primary;
|
|
}
|
|
|
|
&:hover,
|
|
&:focus {
|
|
background-color: transparent;
|
|
}
|
|
|
|
&.disabled,
|
|
&[disabled],
|
|
fieldset[disabled] & {
|
|
&:hover,
|
|
&:focus {
|
|
border-color: transparent;
|
|
color: $btn-link-disabled-color;
|
|
text-decoration: none;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Buttons Icons
|
|
.btn-icon-both {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
|
|
&.btn-block {
|
|
display: flex;
|
|
}
|
|
}
|
|
|
|
// Button Sizes
|
|
// --------------------------------------------------
|
|
|
|
.btn-lg {
|
|
// line-height: ensure even-numbered height of button next to large input
|
|
@include button-size($padding-large-vertical, $padding-large-horizontal, $font-size-large, $line-height-large, $btn-border-radius-base);
|
|
}
|
|
|
|
.btn-sm {
|
|
// line-height: ensure proper height of button next to small input
|
|
@include button-size($padding-small-vertical, $padding-small-horizontal, $font-size-small, $line-height-small, $btn-border-radius-base);
|
|
}
|
|
|
|
.btn-xs {
|
|
@include button-size($padding-xs-vertical, $padding-xs-horizontal, $font-size-small, $line-height-small, $btn-border-radius-base);
|
|
|
|
.bi {
|
|
font-size: $bootstrap-icon-size-small;
|
|
}
|
|
}
|
|
|
|
|
|
// Block button
|
|
// --------------------------------------------------
|
|
|
|
.btn-block {
|
|
display: block;
|
|
width: 100%;
|
|
}
|
|
|
|
// Vertically space out multiple block buttons
|
|
.btn-block + .btn-block {
|
|
margin-top: 5px;
|
|
}
|
|
|
|
// Specificity overrides
|
|
input[type="submit"],
|
|
input[type="reset"],
|
|
input[type="button"] {
|
|
&.btn-block {
|
|
width: 100%;
|
|
}
|
|
}
|
|
|
|
/* todo fix btn-sm size in input-group */
|
|
.input-group {
|
|
.btn-sm {
|
|
@include button-size($padding-base-vertical, $padding-base-horizontal, $font-size-base, $line-height-base, $btn-border-radius-base);
|
|
|
|
}
|
|
}
|
|
|
|
.translations-figure .btn:not(:last-child) {
|
|
margin-right: 0.5em;
|
|
}
|
|
|
|
@keyframes submit-loader {
|
|
0% {
|
|
transform: rotate(0);
|
|
}
|
|
|
|
100% {
|
|
transform: rotate(360deg);
|
|
}
|
|
}
|