A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.
/* SPDX-License-Identifier: AGPL-3.0-or-later */
.button {
display: flex;
align-items: center;
justify-content: center;
padding: 0.4375rem 0.75rem;
font-size: 0.8125rem;
font-weight: 600;
line-height: 1.125rem;
height: 2.25rem;
min-height: 2.25rem;
min-width: 4.5rem;
border-radius: 0.5rem;
border: 0.0625rem solid transparent;
cursor: pointer;
appearance: none;
text-decoration: none;
position: relative;
overflow: hidden;
box-sizing: border-box;
max-width: 100%;
outline: none;
transition:
background-color 0.12s ease,
border-color 0.12s ease,
box-shadow 0.12s ease,
color 0.12s ease,
opacity 0.12s ease;
}
.button.matchSkeletonHeight {
height: 2.25rem;
min-height: 2.25rem;
width: 100%;
}
.button:disabled,
.button[data-disabled] {
cursor: not-allowed;
opacity: 0.5;
}
.button.small {
height: 2.125rem;
min-height: 2.125rem;
min-width: 3.5rem;
padding: 0.375rem 0.625rem;
}
.button.compact {
height: 2rem;
min-height: 2rem;
min-width: 3.25rem;
padding: 0.3125rem 0.625rem;
}
.button.superCompact {
height: 1.625rem;
min-height: 1.625rem;
min-width: 0;
padding: 0.1875rem 0.4375rem;
font-size: 0.75rem;
line-height: 1rem;
border-radius: 0.375rem;
}
.button.fitContent {
min-width: 0;
padding: 0.4375rem 0.75rem;
}
.button.small.fitContent {
padding: 0.375rem 0.625rem;
}
.button.compact.fitContent {
padding: 0.3125rem 0.625rem;
}
.button.superCompact.fitContent {
padding: 0.1875rem 0.4375rem;
}
.button.fitContainer {
width: 100%;
}
:global(html:not(.auth-page):not(.mobile-layout)) .button:not(.square):not(.fitContainer):not(.matchSkeletonHeight) {
flex: 0 0 auto;
width: fit-content;
}
.button.square {
width: 2.25rem;
min-width: 2.25rem;
padding: 0;
}
.button.square.small {
width: 2.125rem;
min-width: 2.125rem;
padding: 0;
}
.button.square.compact {
width: 2rem;
min-width: 2rem;
padding: 0;
}
.button.square.superCompact {
width: 1.625rem;
min-width: 1.625rem;
padding: 0;
}
.button.primary {
background-color: var(--brand-primary);
border-color: color-mix(in srgb, var(--brand-primary) 82%, white 18%);
color: var(--brand-primary-fill);
}
:global(:where(html.window-focused, html.unfocused-fully-interactive):not(.window-focus-activation-guard))
.button.primary:hover:not(:disabled):not([data-disabled]),
.button.primary[data-context-menu-open='true']:not(:disabled):not([data-disabled]) {
background-color: var(--brand-secondary);
border-color: color-mix(in srgb, var(--brand-secondary) 84%, white 16%);
}
.button.primary:active:not(:disabled):not([data-disabled]) {
background-color: var(--brand-primary-pressed);
}
.button.secondary {
background-color: var(--form-surface-background);
border-color: var(--background-modifier-accent);
color: var(--button-secondary-text);
}
:global(.theme-light) .button.secondary {
color: var(--button-ghost-text);
}
:global(:where(html.window-focused, html.unfocused-fully-interactive):not(.window-focus-activation-guard))
.button.secondary:hover:not(:disabled):not([data-disabled]),
.button.secondary[data-context-menu-open='true']:not(:disabled):not([data-disabled]) {
background-color: color-mix(in srgb, var(--form-surface-background) 94%, var(--text-primary) 6%);
border-color: color-mix(in srgb, var(--background-modifier-accent) 88%, var(--text-tertiary) 12%);
color: var(--button-secondary-text);
}
:global(.theme-light:where(.window-focused, .unfocused-fully-interactive):not(.window-focus-activation-guard))
.button.secondary:hover:not(:disabled):not([data-disabled]),
:global(.theme-light) .button.secondary[data-context-menu-open='true']:not(:disabled):not([data-disabled]) {
color: var(--button-ghost-text);
}
.button.danger {
background-color: color-mix(in srgb, var(--button-danger-fill) 92%, var(--background-primary));
border-color: color-mix(in srgb, var(--button-danger-fill) 70%, transparent);
color: var(--button-danger-text);
}
:global(:where(html.window-focused, html.unfocused-fully-interactive):not(.window-focus-activation-guard))
.button.danger:hover:not(:disabled):not([data-disabled]) {
background-color: color-mix(in srgb, var(--button-danger-active-fill) 92%, var(--background-primary));
border-color: color-mix(in srgb, var(--button-danger-active-fill) 72%, transparent);
}
.button.danger:active:not(:disabled):not([data-disabled]) {
background-color: color-mix(in srgb, var(--button-danger-active-fill) 78%, #000);
}
.button.inverted {
background-color: var(--button-inverted-fill);
border-color: transparent;
color: var(--button-inverted-text);
}
.button.invertedOutline {
background-color: transparent;
color: white;
border-color: color-mix(in srgb, white 78%, transparent);
}
:global(:where(html.window-focused, html.unfocused-fully-interactive):not(.window-focus-activation-guard))
.button.invertedOutline:hover:not(:disabled):not([data-disabled]) {
background-color: rgba(255, 255, 255, 0.1);
}
.button.invertedOutline:active:not(:disabled):not([data-disabled]) {
background-color: rgba(255, 255, 255, 0.05);
}
.button.ghost {
background-color: transparent;
border-color: transparent;
color: inherit;
}
:global(:where(html.window-focused, html.unfocused-fully-interactive):not(.window-focus-activation-guard))
.button.ghost:hover:not(:disabled):not([data-disabled]) {
background-color: color-mix(in srgb, currentColor 12%, transparent);
}
.button.ghost:active:not(:disabled):not([data-disabled]) {
background-color: color-mix(in srgb, currentColor 6%, transparent);
}
.button.recording {
background-color: var(--accent-success, #16a34a);
border-color: color-mix(in srgb, var(--accent-success, #16a34a) 80%, white 20%);
color: var(--button-primary-text);
animation: buttonRecordingPulse 1.1s infinite;
}
:global(:where(html.window-focused, html.unfocused-fully-interactive):not(.window-focus-activation-guard))
.button.recording:hover:not(:disabled):not([data-disabled]) {
background-color: color-mix(in srgb, var(--accent-success, #16a34a) 90%, #000 0%);
}
.button.recording:active:not(:disabled):not([data-disabled]) {
animation: none;
}
.spinner {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
}
.spinnerInner {
display: flex;
align-items: center;
justify-content: center;
position: relative;
width: 1.25rem;
height: auto;
}
.spinnerItem {
display: inline-block;
width: 0.3125rem;
height: 0.3125rem;
margin-inline-end: 0.125rem;
background-color: currentColor;
border-radius: 0.25rem;
opacity: 0.3;
animation: spinnerPulsingEllipsis 1.4s ease-in-out infinite;
}
.spinnerItem:nth-of-type(2) {
animation-delay: 0.2s;
}
.spinnerItem:nth-of-type(3) {
animation-delay: 0.4s;
}
.iconWrapper {
display: flex;
align-items: center;
justify-content: center;
gap: 0.375rem;
max-width: 100%;
white-space: nowrap;
}
.iconWrapper :global(svg) {
flex: 0 0 auto;
width: 1rem;
height: 1rem;
}
.button.superCompact .iconWrapper :global(svg) {
width: 0.875rem;
height: 0.875rem;
}
.spinnerWrapper {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: 0;
inset-inline-start: 0;
width: 100%;
height: 100%;
}
.hidden {
opacity: 0;
pointer-events: none;
}
.spinnerWrapper.hidden .spinnerItem {
animation: none;
}
.grid {
display: grid;
width: 100%;
height: 100%;
}
@keyframes spinnerPulsingEllipsis {
0% {
opacity: 1;
transform: scale(1);
}
50% {
opacity: 0.3;
transform: scale(0.8);
}
100% {
opacity: 1;
transform: scale(1);
}
}
@keyframes buttonRecordingPulse {
0% {
box-shadow:
0 0 0 0 color-mix(in srgb, var(--accent-success, #16a34a) 18%, transparent),
0 0 0 0 color-mix(in srgb, var(--accent-success, #16a34a) 0%, transparent);
}
50% {
box-shadow:
0 0 0 0 color-mix(in srgb, var(--accent-success, #16a34a) 28%, transparent),
0 0 0 0.375rem color-mix(in srgb, var(--accent-success, #16a34a) 12%, transparent);
}
100% {
box-shadow:
0 0 0 0 color-mix(in srgb, var(--accent-success, #16a34a) 18%, transparent),
0 0 0 0 color-mix(in srgb, var(--accent-success, #16a34a) 0%, transparent);
}
}
@media (prefers-reduced-motion: reduce) {
.button.recording {
animation: none;
}
.spinnerItem {
animation: none;
opacity: 0.6;
}
}