2020-10-30 20:34:04 +00:00
|
|
|
// Copyright 2016-2020 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2019-10-04 18:06:17 +00:00
|
|
|
// Fonts
|
|
|
|
|
|
|
|
@mixin font-title-1 {
|
|
|
|
font-family: $inter;
|
2021-03-08 17:58:59 +00:00
|
|
|
font-weight: 700;
|
2019-10-04 18:06:17 +00:00
|
|
|
font-size: 28px;
|
|
|
|
line-height: 34px;
|
|
|
|
letter-spacing: -0.56px;
|
|
|
|
}
|
|
|
|
|
|
|
|
@mixin font-title-2 {
|
|
|
|
font-family: $inter;
|
2021-03-08 17:58:59 +00:00
|
|
|
font-weight: 700;
|
2019-10-04 18:06:17 +00:00
|
|
|
font-size: 20px;
|
|
|
|
line-height: 26px;
|
|
|
|
letter-spacing: -0.34px;
|
|
|
|
}
|
|
|
|
|
|
|
|
@mixin font-body-1 {
|
|
|
|
font-family: $inter;
|
2021-03-08 17:58:59 +00:00
|
|
|
font-size: 14px;
|
|
|
|
line-height: 20px;
|
|
|
|
letter-spacing: -0.08px;
|
2019-10-04 18:06:17 +00:00
|
|
|
}
|
|
|
|
@mixin font-body-1-bold {
|
|
|
|
@include font-body-1;
|
2021-03-08 17:58:59 +00:00
|
|
|
font-weight: 600;
|
2019-10-04 18:06:17 +00:00
|
|
|
}
|
|
|
|
@mixin font-body-1-italic {
|
|
|
|
@include font-body-1;
|
|
|
|
font-style: italic;
|
|
|
|
}
|
|
|
|
@mixin font-body-1-bold-italic {
|
|
|
|
@include font-body-1;
|
2021-03-08 17:58:59 +00:00
|
|
|
font-weight: 600;
|
2019-10-04 18:06:17 +00:00
|
|
|
font-style: italic;
|
|
|
|
}
|
|
|
|
|
|
|
|
@mixin font-body-2 {
|
|
|
|
font-family: $inter;
|
2021-03-08 17:58:59 +00:00
|
|
|
font-size: 12px;
|
|
|
|
line-height: 16px;
|
|
|
|
letter-spacing: 0;
|
2019-10-04 18:06:17 +00:00
|
|
|
}
|
|
|
|
@mixin font-body-2-bold {
|
|
|
|
@include font-body-2;
|
2021-03-08 17:58:59 +00:00
|
|
|
font-weight: 600;
|
2019-10-04 18:06:17 +00:00
|
|
|
}
|
|
|
|
@mixin font-body-2-italic {
|
|
|
|
@include font-body-2;
|
|
|
|
font-style: italic;
|
|
|
|
}
|
|
|
|
@mixin font-body-2-bold-italic {
|
|
|
|
@include font-body-2;
|
2021-03-08 17:58:59 +00:00
|
|
|
font-weight: 600;
|
2019-10-04 18:06:17 +00:00
|
|
|
font-style: italic;
|
|
|
|
}
|
|
|
|
|
|
|
|
@mixin font-subtitle {
|
|
|
|
font-family: $inter;
|
2021-03-08 17:58:59 +00:00
|
|
|
font-size: 11px;
|
|
|
|
line-height: 14px;
|
|
|
|
letter-spacing: 0.06px;
|
2019-10-04 18:06:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@mixin font-caption {
|
|
|
|
font-family: $inter;
|
2021-03-08 17:58:59 +00:00
|
|
|
font-size: 10px;
|
|
|
|
line-height: 12px;
|
|
|
|
letter-spacing: 0.1px;
|
2019-10-04 18:06:17 +00:00
|
|
|
}
|
|
|
|
@mixin font-caption-bold {
|
|
|
|
@include font-caption;
|
2021-03-08 17:58:59 +00:00
|
|
|
font-weight: 600;
|
2019-10-04 18:06:17 +00:00
|
|
|
}
|
|
|
|
@mixin font-caption-bold-italic {
|
|
|
|
@include font-caption;
|
2021-03-08 17:58:59 +00:00
|
|
|
font-weight: 600;
|
2019-10-04 18:06:17 +00:00
|
|
|
font-style: italic;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Themes
|
|
|
|
|
|
|
|
@mixin light-theme() {
|
|
|
|
@content;
|
2018-05-08 16:51:19 +00:00
|
|
|
}
|
|
|
|
|
2019-10-04 18:06:17 +00:00
|
|
|
@mixin dark-theme() {
|
|
|
|
.dark-theme & {
|
|
|
|
@content;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@mixin ios-theme() {
|
|
|
|
.ios-theme & {
|
|
|
|
@content;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@mixin ios-dark-theme() {
|
|
|
|
.dark-theme.ios-theme & {
|
|
|
|
@content;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Icons
|
|
|
|
|
2019-08-20 19:15:13 +00:00
|
|
|
@mixin color-svg($svg, $color, $stretch: true) {
|
2018-05-04 20:07:52 +00:00
|
|
|
-webkit-mask: url($svg) no-repeat center;
|
2019-08-20 19:15:13 +00:00
|
|
|
@if $stretch {
|
|
|
|
-webkit-mask-size: 100%;
|
|
|
|
}
|
2018-05-04 20:07:52 +00:00
|
|
|
background-color: $color;
|
2016-04-09 07:17:08 +00:00
|
|
|
}
|
2018-05-08 20:14:28 +00:00
|
|
|
|
2016-04-09 07:17:08 +00:00
|
|
|
@mixin header-icon-white($svg) {
|
2019-10-04 18:06:17 +00:00
|
|
|
@include color-svg($svg, $color-white-alpha-80);
|
2018-05-04 20:07:52 +00:00
|
|
|
&:focus,
|
|
|
|
&:hover {
|
2019-10-04 18:06:17 +00:00
|
|
|
@include color-svg($svg, $color-white);
|
2016-04-09 07:17:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
@mixin header-icon-black($svg) {
|
2019-10-04 18:06:17 +00:00
|
|
|
@include color-svg($svg, $color-black-alpha-40);
|
2018-05-04 20:07:52 +00:00
|
|
|
&:focus,
|
|
|
|
&:hover {
|
2016-04-09 07:17:08 +00:00
|
|
|
@include color-svg($svg, black);
|
|
|
|
}
|
|
|
|
}
|
2019-04-22 18:25:37 +00:00
|
|
|
|
2019-11-21 19:16:06 +00:00
|
|
|
// Keyboard
|
|
|
|
|
|
|
|
@mixin keyboard-mode() {
|
|
|
|
.keyboard-mode & {
|
|
|
|
@content;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@mixin mouse-mode() {
|
|
|
|
.mouse-mode & {
|
|
|
|
@content;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@mixin dark-keyboard-mode() {
|
|
|
|
.dark-theme.keyboard-mode & {
|
|
|
|
@content;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@mixin ios-keyboard-mode() {
|
|
|
|
.ios-theme.keyboard-mode & {
|
|
|
|
@content;
|
|
|
|
}
|
|
|
|
}
|
2020-07-24 01:35:32 +00:00
|
|
|
|
|
|
|
@mixin dark-mouse-mode() {
|
|
|
|
.dark-theme.mouse-mode & {
|
|
|
|
@content;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@mixin ios-mouse-mode() {
|
|
|
|
.ios-theme.mouse-mode & {
|
|
|
|
@content;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-11-21 19:16:06 +00:00
|
|
|
@mixin dark-ios-keyboard-mode() {
|
|
|
|
.dark-theme.ios-theme.keyboard-mode & {
|
|
|
|
@content;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-04 18:06:17 +00:00
|
|
|
// Other
|
2019-04-22 18:25:37 +00:00
|
|
|
|
2019-10-04 18:06:17 +00:00
|
|
|
@mixin popper-shadow() {
|
2019-10-17 18:22:07 +00:00
|
|
|
box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.3), 0px 0px 8px rgba(0, 0, 0, 0.05);
|
2019-04-22 18:25:37 +00:00
|
|
|
}
|
2019-05-16 22:32:11 +00:00
|
|
|
|
2019-10-04 18:06:17 +00:00
|
|
|
@mixin button-reset {
|
|
|
|
background: none;
|
|
|
|
color: inherit;
|
|
|
|
border: none;
|
|
|
|
padding: 0;
|
2019-11-07 21:36:16 +00:00
|
|
|
margin: 0;
|
2019-10-04 18:06:17 +00:00
|
|
|
font: inherit;
|
|
|
|
cursor: pointer;
|
|
|
|
outline: inherit;
|
2019-11-07 21:36:16 +00:00
|
|
|
text-align: inherit;
|
2019-05-16 22:32:11 +00:00
|
|
|
}
|
2020-11-20 17:30:45 +00:00
|
|
|
|
2020-12-03 16:06:39 +00:00
|
|
|
// --- Buttons
|
|
|
|
|
|
|
|
// Individual traits
|
|
|
|
|
|
|
|
@mixin button-focus-outline {
|
|
|
|
&:focus {
|
|
|
|
@include keyboard-mode {
|
|
|
|
box-shadow: 0px 0px 0px 3px $ultramarine-ui-light;
|
|
|
|
}
|
|
|
|
@include dark-keyboard-mode {
|
|
|
|
box-shadow: 0px 0px 0px 3px $ultramarine-ui-dark;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@mixin button-blue-text {
|
|
|
|
@include light-theme {
|
|
|
|
color: $ultramarine-ui-light;
|
|
|
|
}
|
|
|
|
@include dark-theme {
|
|
|
|
color: $ultramarine-ui-dark;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Complete button styles
|
2020-11-20 17:30:45 +00:00
|
|
|
|
|
|
|
@mixin button-primary {
|
|
|
|
background-color: $ultramarine-ui-light;
|
|
|
|
|
|
|
|
// Note: the background colors here need to match the parent component
|
|
|
|
@include light-theme {
|
|
|
|
color: $color-white;
|
|
|
|
border: 1px solid white;
|
|
|
|
}
|
|
|
|
@include dark-theme {
|
|
|
|
color: $color-white-alpha-90;
|
|
|
|
border: 1px solid $color-gray-95;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
@include mouse-mode {
|
|
|
|
background-color: mix($color-black, $ultramarine-ui-light, 15%);
|
|
|
|
}
|
|
|
|
|
|
|
|
@include dark-mouse-mode {
|
|
|
|
background-color: mix($color-white, $ultramarine-ui-light, 15%);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&:active {
|
2020-12-03 16:06:39 +00:00
|
|
|
// We need to include all four here for specificity precedence
|
|
|
|
|
|
|
|
@include mouse-mode {
|
2020-11-20 17:30:45 +00:00
|
|
|
background-color: mix($color-black, $ultramarine-ui-light, 25%);
|
|
|
|
}
|
2020-12-03 16:06:39 +00:00
|
|
|
@include dark-mouse-mode {
|
2020-11-20 17:30:45 +00:00
|
|
|
background-color: mix($color-white, $ultramarine-ui-light, 25%);
|
|
|
|
}
|
|
|
|
|
|
|
|
@include keyboard-mode {
|
2020-12-03 16:06:39 +00:00
|
|
|
background-color: mix($color-black, $ultramarine-ui-light, 25%);
|
2020-11-20 17:30:45 +00:00
|
|
|
}
|
|
|
|
@include dark-keyboard-mode {
|
2020-12-03 16:06:39 +00:00
|
|
|
background-color: mix($color-black, $ultramarine-ui-light, 25%);
|
2020-11-20 17:30:45 +00:00
|
|
|
}
|
|
|
|
}
|
2020-12-03 16:06:39 +00:00
|
|
|
|
|
|
|
@include button-focus-outline;
|
2020-11-20 17:30:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@mixin button-secondary {
|
|
|
|
@include light-theme {
|
|
|
|
color: $color-gray-90;
|
|
|
|
background-color: $color-gray-05;
|
|
|
|
}
|
|
|
|
@include dark-theme {
|
|
|
|
color: $color-gray-05;
|
|
|
|
background-color: $color-gray-65;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
@include mouse-mode {
|
|
|
|
background-color: mix($color-black, $color-gray-05, 15%);
|
|
|
|
}
|
|
|
|
|
|
|
|
@include dark-mouse-mode {
|
|
|
|
background-color: mix($color-white, $color-gray-65, 15%);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&:active {
|
2020-12-03 16:06:39 +00:00
|
|
|
// We need to include all four here for specificity precedence
|
|
|
|
|
|
|
|
@include mouse-mode {
|
2020-11-20 17:30:45 +00:00
|
|
|
background-color: mix($color-black, $color-gray-05, 25%);
|
|
|
|
}
|
2020-12-03 16:06:39 +00:00
|
|
|
@include dark-mouse-mode {
|
|
|
|
background-color: mix($color-white, $color-gray-65, 25%);
|
|
|
|
}
|
2020-11-20 17:30:45 +00:00
|
|
|
|
2020-12-03 16:06:39 +00:00
|
|
|
@include keyboard-mode {
|
|
|
|
background-color: mix($color-black, $color-gray-05, 25%);
|
|
|
|
}
|
|
|
|
@include dark-keyboard-mode {
|
2020-11-20 17:30:45 +00:00
|
|
|
background-color: mix($color-white, $color-gray-65, 25%);
|
|
|
|
}
|
|
|
|
}
|
2020-12-03 16:06:39 +00:00
|
|
|
|
|
|
|
@include button-focus-outline;
|
2020-11-20 17:30:45 +00:00
|
|
|
}
|
2020-12-03 16:06:39 +00:00
|
|
|
|
2020-11-20 17:30:45 +00:00
|
|
|
@mixin button-secondary-blue-text {
|
2020-12-03 16:06:39 +00:00
|
|
|
@include button-secondary;
|
|
|
|
@include button-blue-text;
|
|
|
|
}
|
|
|
|
|
|
|
|
@mixin button-light {
|
2020-11-20 17:30:45 +00:00
|
|
|
@include light-theme {
|
2020-12-03 16:06:39 +00:00
|
|
|
color: $color-gray-90;
|
|
|
|
background-color: $color-gray-02;
|
2020-11-20 17:30:45 +00:00
|
|
|
}
|
|
|
|
@include dark-theme {
|
2020-12-03 16:06:39 +00:00
|
|
|
color: $color-gray-05;
|
|
|
|
background-color: $color-gray-75;
|
2020-11-20 17:30:45 +00:00
|
|
|
}
|
2020-12-03 16:06:39 +00:00
|
|
|
|
|
|
|
&:hover {
|
|
|
|
@include mouse-mode {
|
|
|
|
background-color: mix($color-black, $color-gray-02, 10%);
|
|
|
|
}
|
|
|
|
|
|
|
|
@include dark-mouse-mode {
|
|
|
|
background-color: mix($color-white, $color-gray-75, 10%);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&:active {
|
|
|
|
// We need to include all four here for specificity precedence
|
|
|
|
|
|
|
|
@include mouse-mode {
|
|
|
|
background-color: mix($color-black, $color-gray-02, 20%);
|
|
|
|
}
|
|
|
|
@include dark-mouse-mode {
|
|
|
|
background-color: mix($color-white, $color-gray-75, 20%);
|
|
|
|
}
|
|
|
|
|
|
|
|
@include keyboard-mode {
|
|
|
|
background-color: mix($color-black, $color-gray-02, 20%);
|
|
|
|
}
|
|
|
|
@include dark-keyboard-mode {
|
|
|
|
background-color: mix($color-white, $color-gray-75, 20%);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@include button-focus-outline;
|
|
|
|
}
|
|
|
|
|
|
|
|
@mixin button-light-blue-text {
|
|
|
|
@include button-light;
|
|
|
|
@include button-blue-text;
|
2020-11-20 17:30:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@mixin button-destructive {
|
|
|
|
@include light-theme {
|
|
|
|
color: $color-white;
|
|
|
|
background-color: $color-accent-red;
|
|
|
|
}
|
|
|
|
@include dark-theme {
|
|
|
|
color: $color-white-alpha-90;
|
|
|
|
background-color: $color-accent-red;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
@include mouse-mode {
|
|
|
|
background-color: mix($color-black, $color-accent-red, 15%);
|
|
|
|
}
|
|
|
|
|
|
|
|
@include dark-mouse-mode {
|
|
|
|
background-color: mix($color-white, $color-accent-red, 15%);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&:active {
|
2020-12-03 16:06:39 +00:00
|
|
|
// We need to include all four here for specificity precedence
|
|
|
|
|
|
|
|
@include mouse-mode {
|
2020-11-20 17:30:45 +00:00
|
|
|
background-color: mix($color-black, $color-accent-red, 25%);
|
|
|
|
}
|
2020-12-03 16:06:39 +00:00
|
|
|
@include dark-mouse-mode {
|
|
|
|
background-color: mix($color-white, $color-accent-red, 25%);
|
|
|
|
}
|
2020-11-20 17:30:45 +00:00
|
|
|
|
2020-12-03 16:06:39 +00:00
|
|
|
@include keyboard-mode {
|
|
|
|
background-color: mix($color-black, $color-accent-red, 25%);
|
|
|
|
}
|
|
|
|
@include dark-keyboard-mode {
|
2020-11-20 17:30:45 +00:00
|
|
|
background-color: mix($color-white, $color-accent-red, 25%);
|
|
|
|
}
|
|
|
|
}
|
2020-12-03 16:06:39 +00:00
|
|
|
|
|
|
|
@include button-focus-outline;
|
2020-11-20 17:30:45 +00:00
|
|
|
}
|
2020-12-07 20:43:19 +00:00
|
|
|
|
|
|
|
@mixin button-green {
|
|
|
|
$background-color: $color-accent-green;
|
|
|
|
|
|
|
|
background-color: $background-color;
|
|
|
|
color: $color-white;
|
|
|
|
|
|
|
|
&:active {
|
|
|
|
// We need to include all four here for specificity precedence
|
|
|
|
|
|
|
|
@include mouse-mode {
|
|
|
|
background-color: mix($color-black, $background-color, 25%);
|
|
|
|
}
|
|
|
|
@include dark-mouse-mode {
|
|
|
|
background-color: mix($color-white, $background-color, 25%);
|
|
|
|
}
|
|
|
|
|
|
|
|
@include keyboard-mode {
|
|
|
|
background-color: mix($color-black, $background-color, 25%);
|
|
|
|
}
|
|
|
|
@include dark-keyboard-mode {
|
|
|
|
background-color: mix($color-white, $background-color, 25%);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&[disabled] {
|
|
|
|
opacity: 0.6;
|
|
|
|
}
|
|
|
|
|
|
|
|
@include button-focus-outline;
|
|
|
|
}
|
|
|
|
|
|
|
|
@mixin button-small {
|
|
|
|
border-radius: 9999px; // This ensures the borders are completely rounded. (A value like 100% would make it an ellipse.)
|
|
|
|
padding: 7px 14px;
|
|
|
|
}
|