signal-desktop/stylesheets/components/Input.scss

147 lines
2.8 KiB
SCSS
Raw Normal View History

2021-10-01 21:52:36 +00:00
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
2024-11-15 23:09:31 +00:00
@use '../mixins';
@use '../variables';
2021-07-19 19:26:06 +00:00
.Input {
&__container {
2024-11-15 23:09:31 +00:00
@include mixins.font-body-1;
2021-07-19 19:26:06 +00:00
border-radius: 6px;
border-style: solid;
border-width: 2px;
2023-04-20 17:03:43 +00:00
margin-block: 16px;
margin-inline: 0;
padding-block: 2px;
padding-inline: 16px;
2022-10-18 17:12:02 +00:00
display: flex;
2021-07-19 19:26:06 +00:00
position: relative;
2022-10-18 17:12:02 +00:00
&--expandable {
2023-04-20 17:03:43 +00:00
padding-block: 2px;
padding-inline: 8px;
2022-10-18 17:12:02 +00:00
}
2024-11-15 23:09:31 +00:00
@include mixins.light-theme {
background: variables.$color-white;
border-color: variables.$color-gray-15;
color: variables.$color-black;
2021-07-19 19:26:06 +00:00
}
2024-11-15 23:09:31 +00:00
@include mixins.dark-theme {
background: variables.$color-gray-80;
border-color: variables.$color-gray-45;
color: variables.$color-gray-05;
2021-07-19 19:26:06 +00:00
}
&--disabled {
2024-11-15 23:09:31 +00:00
@include mixins.light-theme {
background: variables.$color-gray-02;
border-color: variables.$color-gray-05;
color: variables.$color-gray-90;
2021-07-19 19:26:06 +00:00
}
2024-11-15 23:09:31 +00:00
@include mixins.dark-theme {
background: variables.$color-gray-95;
border-color: variables.$color-gray-60;
color: variables.$color-gray-20;
2021-07-19 19:26:06 +00:00
}
}
&:focus-within {
outline: none;
2024-11-15 23:09:31 +00:00
@include mixins.light-theme {
border-color: variables.$color-ultramarine;
2021-07-19 19:26:06 +00:00
}
2024-11-15 23:09:31 +00:00
@include mixins.dark-theme {
border-color: variables.$color-ultramarine-light;
2021-07-19 19:26:06 +00:00
}
}
}
&__icon {
font-size: 24px;
height: 32px;
width: 32px;
2023-04-20 17:03:43 +00:00
margin-inline-end: 8px;
2021-07-19 19:26:06 +00:00
}
&__input {
2024-11-15 23:09:31 +00:00
@include mixins.font-body-1;
2021-07-19 19:26:06 +00:00
background: inherit;
border: none;
resize: none;
width: 100%;
&--large {
height: 280px;
}
2024-03-26 19:48:33 +00:00
&--textarea {
2022-10-18 17:12:02 +00:00
margin-top: 4px;
2021-07-19 19:26:06 +00:00
}
&:placeholder {
2024-11-15 23:09:31 +00:00
color: variables.$color-gray-45;
2021-07-19 19:26:06 +00:00
}
2024-11-15 23:09:31 +00:00
@include mixins.light-theme {
color: variables.$color-black;
2021-07-19 19:26:06 +00:00
}
2024-11-15 23:09:31 +00:00
@include mixins.dark-theme {
color: variables.$color-gray-05;
2021-07-19 19:26:06 +00:00
}
&:focus {
outline: none;
}
}
&__controls {
align-items: center;
display: flex;
2022-10-18 17:12:02 +00:00
flex-shrink: 0;
2021-07-19 19:26:06 +00:00
height: 22px;
justify-content: flex-end;
2022-10-18 17:12:02 +00:00
min-height: 32px;
2021-07-19 19:26:06 +00:00
}
&__clear-icon {
height: 18px;
width: 18px;
2024-11-15 23:09:31 +00:00
@include mixins.light-theme {
@include mixins.color-svg(
'../images/icons/v3/x/x.svg',
variables.$color-gray-60
);
2021-07-19 19:26:06 +00:00
}
2024-11-15 23:09:31 +00:00
@include mixins.dark-theme {
@include mixins.color-svg(
'../images/icons/v3/x/x.svg',
variables.$color-gray-25
);
2021-07-19 19:26:06 +00:00
}
}
&__remaining-count {
2024-11-15 23:09:31 +00:00
@include mixins.font-subtitle;
color: variables.$color-gray-45;
2021-07-19 19:26:06 +00:00
&--large {
position: absolute;
2022-10-18 17:12:02 +00:00
bottom: 0;
2023-04-20 17:03:43 +00:00
inset-inline-end: 0;
2022-10-18 17:12:02 +00:00
margin: 12px;
2021-07-19 19:26:06 +00:00
}
2024-03-26 19:48:33 +00:00
&--warn {
2024-11-15 23:09:31 +00:00
color: variables.$color-accent-red;
2024-03-26 19:48:33 +00:00
}
2021-07-19 19:26:06 +00:00
}
}