2021-02-23 19:28:48 +00:00
|
|
|
// Copyright 2021 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
.module-Button {
|
|
|
|
@mixin focus-box-shadow($inner-color, $outer-color) {
|
|
|
|
&:focus {
|
|
|
|
box-shadow: 0 0 0 1px $inner-color, 0 0 0 4px $outer-color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@mixin hover-and-active-states($background-color, $mix-color) {
|
2023-03-20 22:23:53 +00:00
|
|
|
&:hover {
|
|
|
|
@include not-disabled {
|
|
|
|
background: mix($background-color, $mix-color, 85%);
|
|
|
|
}
|
2021-02-23 19:28:48 +00:00
|
|
|
}
|
2023-03-20 22:23:53 +00:00
|
|
|
&:active {
|
|
|
|
@include not-disabled {
|
|
|
|
background: mix($background-color, $mix-color, 75%);
|
|
|
|
}
|
2021-02-23 19:28:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@include button-reset;
|
|
|
|
border-radius: 4px;
|
2023-04-20 17:03:43 +00:00
|
|
|
padding-block: 8px;
|
|
|
|
padding-inline: 16px;
|
2021-02-23 19:28:48 +00:00
|
|
|
text-align: center;
|
|
|
|
user-select: none;
|
2023-06-06 13:53:10 +00:00
|
|
|
-webkit-app-region: no-drag;
|
2021-02-23 19:28:48 +00:00
|
|
|
|
|
|
|
@include keyboard-mode {
|
2021-05-28 16:15:17 +00:00
|
|
|
@include focus-box-shadow($color-white, $color-ultramarine);
|
2021-02-23 19:28:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@include dark-keyboard-mode {
|
2021-05-28 16:15:17 +00:00
|
|
|
@include focus-box-shadow($color-black, $color-ultramarine-icon);
|
2021-02-23 19:28:48 +00:00
|
|
|
}
|
|
|
|
|
2023-03-20 22:23:53 +00:00
|
|
|
@include disabled {
|
2021-02-24 22:53:49 +00:00
|
|
|
cursor: not-allowed;
|
|
|
|
}
|
|
|
|
|
2021-11-16 16:45:16 +00:00
|
|
|
&--large {
|
|
|
|
@include font-title-2;
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
|
2021-04-30 22:58:57 +00:00
|
|
|
&--medium {
|
|
|
|
@include font-body-1-bold;
|
|
|
|
}
|
|
|
|
|
|
|
|
&--small {
|
|
|
|
@include font-body-2;
|
|
|
|
@include rounded-corners;
|
2023-04-20 17:03:43 +00:00
|
|
|
padding-block: 6px;
|
|
|
|
padding-inline: 12px;
|
2021-04-30 22:58:57 +00:00
|
|
|
}
|
|
|
|
|
2021-02-23 19:28:48 +00:00
|
|
|
&--primary {
|
|
|
|
$color: $color-white;
|
2021-05-28 16:15:17 +00:00
|
|
|
$background-color: $color-ultramarine;
|
2021-02-23 19:28:48 +00:00
|
|
|
|
|
|
|
color: $color;
|
|
|
|
background: $background-color;
|
|
|
|
|
2023-03-20 22:23:53 +00:00
|
|
|
@include disabled {
|
2021-02-23 19:28:48 +00:00
|
|
|
color: fade-out($color, 0.4);
|
|
|
|
background: fade-out($background-color, 0.6);
|
|
|
|
}
|
|
|
|
|
|
|
|
@include light-theme {
|
|
|
|
@include hover-and-active-states($background-color, $color-black);
|
|
|
|
}
|
|
|
|
|
|
|
|
@include dark-theme {
|
|
|
|
@include hover-and-active-states($background-color, $color-white);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&--secondary {
|
|
|
|
@include light-theme {
|
|
|
|
$color: $color-gray-90;
|
|
|
|
$background-color: $color-gray-05;
|
|
|
|
|
|
|
|
color: $color;
|
|
|
|
background: $background-color;
|
|
|
|
|
2023-03-20 22:23:53 +00:00
|
|
|
@include disabled {
|
2021-02-23 19:28:48 +00:00
|
|
|
color: $color-black-alpha-40;
|
|
|
|
background: fade-out($background-color, 0.6);
|
|
|
|
}
|
|
|
|
|
2021-04-20 14:41:04 +00:00
|
|
|
&--affirmative {
|
2021-05-28 16:15:17 +00:00
|
|
|
color: $color-ultramarine;
|
2021-04-06 22:14:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&--destructive {
|
|
|
|
color: $color-accent-red;
|
|
|
|
}
|
|
|
|
|
2021-02-23 19:28:48 +00:00
|
|
|
@include hover-and-active-states($background-color, $color-black);
|
|
|
|
}
|
|
|
|
|
|
|
|
@include dark-theme {
|
|
|
|
$color: $color-gray-05;
|
|
|
|
$background-color: $color-gray-65;
|
|
|
|
|
|
|
|
color: $color;
|
|
|
|
background: $background-color;
|
|
|
|
|
2023-03-20 22:23:53 +00:00
|
|
|
@include disabled {
|
2021-02-23 19:28:48 +00:00
|
|
|
color: $color-white-alpha-20;
|
|
|
|
background: fade-out($background-color, 0.6);
|
|
|
|
}
|
|
|
|
|
2021-04-20 14:41:04 +00:00
|
|
|
&--affirmative {
|
2021-05-28 16:15:17 +00:00
|
|
|
color: $color-ultramarine-light;
|
2021-04-06 22:14:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&--destructive {
|
|
|
|
color: $color-accent-red;
|
|
|
|
}
|
|
|
|
|
2021-02-23 19:28:48 +00:00
|
|
|
@include hover-and-active-states($background-color, $color-white);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&--destructive {
|
|
|
|
$color: $color-white;
|
|
|
|
$background-color: $color-accent-red;
|
|
|
|
|
|
|
|
color: $color;
|
|
|
|
background: $background-color;
|
|
|
|
|
2023-03-20 22:23:53 +00:00
|
|
|
@include disabled {
|
2021-02-23 19:28:48 +00:00
|
|
|
color: fade-out($color, 0.4);
|
|
|
|
background: fade-out($background-color, 0.6);
|
|
|
|
}
|
|
|
|
|
|
|
|
@include light-theme {
|
|
|
|
@include hover-and-active-states($background-color, $color-black);
|
|
|
|
}
|
|
|
|
|
|
|
|
@include dark-theme {
|
|
|
|
@include hover-and-active-states($background-color, $color-white);
|
|
|
|
}
|
|
|
|
}
|
2021-08-17 21:45:18 +00:00
|
|
|
|
|
|
|
&--calling {
|
|
|
|
$color: $color-white;
|
|
|
|
$background-color: $color-accent-green;
|
|
|
|
|
|
|
|
@include rounded-corners;
|
|
|
|
color: $color;
|
|
|
|
background: $background-color;
|
|
|
|
|
2023-03-20 22:23:53 +00:00
|
|
|
@include disabled {
|
2021-08-17 21:45:18 +00:00
|
|
|
color: fade-out($color, 0.4);
|
|
|
|
background: fade-out($background-color, 0.6);
|
|
|
|
}
|
|
|
|
|
|
|
|
@include light-theme {
|
|
|
|
@include hover-and-active-states($background-color, $color-black);
|
|
|
|
}
|
|
|
|
|
|
|
|
@include dark-theme {
|
|
|
|
@include hover-and-active-states($background-color, $color-white);
|
|
|
|
}
|
|
|
|
}
|
2021-08-26 20:51:55 +00:00
|
|
|
|
|
|
|
&--system-message {
|
|
|
|
@include rounded-corners;
|
|
|
|
|
2021-09-07 19:55:03 +00:00
|
|
|
&.module-Button--small {
|
2023-04-20 17:03:43 +00:00
|
|
|
padding-top: 5px;
|
|
|
|
padding-bottom: 5px;
|
2021-09-07 19:55:03 +00:00
|
|
|
font-weight: 500;
|
|
|
|
}
|
|
|
|
|
2021-08-26 20:51:55 +00:00
|
|
|
@include light-theme {
|
|
|
|
$color: $color-ultramarine;
|
|
|
|
$background-color: $color-gray-02;
|
|
|
|
|
|
|
|
color: $color;
|
|
|
|
background: $background-color;
|
|
|
|
|
2023-03-20 22:23:53 +00:00
|
|
|
@include disabled {
|
2021-08-26 20:51:55 +00:00
|
|
|
color: fade-out($color, 0.4);
|
|
|
|
background: fade-out($background-color, 0.6);
|
|
|
|
}
|
|
|
|
@include hover-and-active-states($background-color, $color-black);
|
|
|
|
}
|
|
|
|
|
|
|
|
@include dark-theme {
|
|
|
|
$color: $color-white;
|
|
|
|
$background-color: $color-gray-65;
|
|
|
|
|
|
|
|
color: $color;
|
|
|
|
background: $background-color;
|
|
|
|
|
2023-03-20 22:23:53 +00:00
|
|
|
@include disabled {
|
2021-08-26 20:51:55 +00:00
|
|
|
color: fade-out($color, 0.4);
|
|
|
|
background: fade-out($background-color, 0.6);
|
|
|
|
}
|
|
|
|
@include hover-and-active-states($background-color, $color-white);
|
|
|
|
}
|
|
|
|
}
|
2021-10-20 23:46:41 +00:00
|
|
|
|
|
|
|
&--details {
|
|
|
|
align-items: center;
|
|
|
|
border-radius: 8px;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2021-10-27 23:33:06 +00:00
|
|
|
font-size: 11px;
|
2021-10-20 23:46:41 +00:00
|
|
|
justify-content: center;
|
2021-10-27 23:33:06 +00:00
|
|
|
line-height: 10px;
|
2021-10-20 23:46:41 +00:00
|
|
|
min-height: 44px;
|
2021-10-27 23:33:06 +00:00
|
|
|
min-width: 68px;
|
|
|
|
padding: 8px;
|
2021-10-20 23:46:41 +00:00
|
|
|
|
|
|
|
@include light-theme {
|
|
|
|
background-color: $color-gray-05;
|
|
|
|
color: $color-black;
|
|
|
|
}
|
|
|
|
|
|
|
|
@include dark-theme {
|
|
|
|
background-color: $color-gray-65;
|
|
|
|
color: $color-gray-05;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:focus {
|
2021-10-21 21:04:43 +00:00
|
|
|
@include keyboard-mode {
|
|
|
|
box-shadow: 0 0 0 2px $color-ultramarine;
|
|
|
|
}
|
2021-10-20 23:46:41 +00:00
|
|
|
}
|
2021-10-27 23:33:06 +00:00
|
|
|
|
|
|
|
&::before {
|
|
|
|
margin-bottom: 6px;
|
|
|
|
}
|
2021-10-20 23:46:41 +00:00
|
|
|
}
|
|
|
|
|
2021-10-27 23:33:06 +00:00
|
|
|
&--icon {
|
2021-10-20 23:46:41 +00:00
|
|
|
@mixin button-icon($icon) {
|
|
|
|
content: '';
|
|
|
|
display: block;
|
|
|
|
height: 18px;
|
|
|
|
width: 18px;
|
|
|
|
|
|
|
|
@include light-theme {
|
|
|
|
@include color-svg($icon, $color-black);
|
|
|
|
}
|
|
|
|
@include dark-theme {
|
|
|
|
@include color-svg($icon, $color-gray-05);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&--audio::before {
|
2023-05-04 18:04:22 +00:00
|
|
|
@include button-icon('../images/icons/v3/phone/phone-compact.svg');
|
2021-10-20 23:46:41 +00:00
|
|
|
}
|
|
|
|
|
2023-08-09 00:53:06 +00:00
|
|
|
&--message::before {
|
|
|
|
@include button-icon('../images/icons/v3/chat/chat-compact.svg');
|
|
|
|
}
|
|
|
|
|
2021-10-20 23:46:41 +00:00
|
|
|
&--muted::before {
|
2023-05-04 18:04:22 +00:00
|
|
|
@include button-icon('../images/icons/v3/bell/bell-slash-compact.svg');
|
2021-10-20 23:46:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&--search::before {
|
2023-05-04 18:04:22 +00:00
|
|
|
@include button-icon('../images/icons/v3/search/search-compact.svg');
|
2021-10-20 23:46:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&--unmuted::before {
|
2023-05-04 18:04:22 +00:00
|
|
|
@include button-icon('../images/icons/v3/bell/bell-compact.svg');
|
2021-10-20 23:46:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&--video::before {
|
2023-05-04 18:04:22 +00:00
|
|
|
@include button-icon('../images/icons/v3/video/video-compact.svg');
|
2021-10-20 23:46:41 +00:00
|
|
|
}
|
|
|
|
}
|
2021-02-23 19:28:48 +00:00
|
|
|
}
|