Files
element-call/src/input/Input.module.css

213 lines
4.3 KiB
CSS
Raw Normal View History

2023-01-03 16:58:38 +00:00
/*
Copyright 2022-2024 New Vector Ltd.
2023-01-03 16:58:38 +00:00
SPDX-License-Identifier: AGPL-3.0-only
Please see LICENSE in the repository root for full details.
2023-01-03 16:58:38 +00:00
*/
2021-08-19 17:49:45 -07:00
.fieldRow {
display: flex;
2021-12-13 15:57:46 -08:00
margin-bottom: 32px;
2021-12-20 13:15:35 -08:00
align-items: center;
2021-08-19 17:49:45 -07:00
}
.field {
display: flex;
flex: 1;
min-width: 0;
position: relative;
}
.fieldRow.rightAlign {
justify-content: flex-end;
}
2021-12-13 14:54:44 -08:00
.fieldRow > * {
margin-right: 24px;
2021-08-19 17:49:45 -07:00
}
2021-12-13 14:54:44 -08:00
.fieldRow > :last-child {
2021-08-19 17:49:45 -07:00
margin-right: 0;
}
2021-09-03 15:45:07 -07:00
.inputField {
border-radius: 4px;
2021-10-06 16:47:05 -07:00
transition: border-color 0.25s;
border: 1px solid var(--cpd-color-border-interactive-primary);
2021-09-03 15:45:07 -07:00
}
2022-02-23 16:07:14 -08:00
.inputField input,
.inputField textarea {
2021-08-19 17:49:45 -07:00
font-weight: 400;
font-size: var(--font-size-body);
2021-08-19 17:49:45 -07:00
border: none;
border-radius: 4px;
padding: 12px 9px 10px 9px;
color: var(--cpd-color-text-primary);
background-color: var(--cpd-color-bg-canvas-default);
2021-08-19 17:49:45 -07:00
flex: 1;
min-width: 0;
}
.inputField.disabled input,
2022-02-23 16:07:14 -08:00
.inputField.disabled textarea,
.inputField.disabled span {
color: var(--cpd-color-text-disabled);
}
2021-12-15 10:54:01 -08:00
.inputField span {
padding: 11px 9px;
}
.inputField span:first-child {
padding-right: 0;
}
2022-02-23 16:07:14 -08:00
.inputField input::placeholder,
.inputField textarea::placeholder {
2021-08-19 17:49:45 -07:00
transition: color 0.25s ease-in 0s;
color: transparent;
}
2022-02-23 16:07:14 -08:00
.inputField input:placeholder-shown:focus::placeholder,
.inputField textarea:placeholder-shown:focus::placeholder {
2021-10-06 16:47:05 -07:00
transition: color 0.25s ease-in 0.1s;
color: var(--cpd-color-text-placeholder);
2021-08-19 17:49:45 -07:00
}
2021-09-03 15:45:07 -07:00
.inputField label {
2023-10-11 10:42:04 -04:00
transition:
font-size 0.25s ease-out 0.1s,
color 0.25s ease-out 0.1s,
top 0.25s ease-out 0.1s,
background-color 0.25s ease-out 0.1s;
color: var(--cpd-color-text-secondary);
2021-08-19 17:49:45 -07:00
background-color: transparent;
font-size: var(--font-size-body);
2021-08-19 17:49:45 -07:00
position: absolute;
left: 0;
top: 0;
2021-12-07 17:59:55 -08:00
margin: 9px 8px;
2021-08-19 17:49:45 -07:00
padding: 2px;
pointer-events: none;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
max-width: calc(100% - 20px);
}
2021-09-03 15:45:07 -07:00
.inputField:focus-within {
border-color: var(--cpd-color-text-link-external);
2021-08-20 16:23:12 -07:00
}
2022-02-23 16:07:14 -08:00
.inputField input:focus,
.inputField textarea:focus {
2021-08-20 16:23:12 -07:00
outline: 0;
}
2021-10-06 16:47:05 -07:00
.inputField input:focus + label,
2021-12-15 10:54:01 -08:00
.inputField input:not(:placeholder-shown) + label,
2022-02-23 16:34:11 -08:00
.inputField.prefix input + label,
2022-02-23 16:07:14 -08:00
.inputField textarea:focus + label,
.inputField textarea:not(:placeholder-shown) + label,
.inputField.prefix textarea + label {
background-color: var(--cpd-color-bg-canvas-default);
2023-10-11 10:42:04 -04:00
transition:
font-size 0.25s ease-out 0s,
color 0.25s ease-out 0s,
top 0.25s ease-out 0s,
background-color 0.25s ease-out 0s;
font-size: var(--font-size-micro);
2021-08-19 17:49:45 -07:00
top: -13px;
padding: 0 2px;
pointer-events: auto;
}
2022-02-23 16:07:14 -08:00
.inputField input:focus + label,
.inputField textarea:focus + label {
color: var(--cpd-color-border-focused);
2021-08-20 16:23:12 -07:00
}
2021-09-03 15:45:07 -07:00
.checkboxField {
display: flex;
align-items: flex-start;
2022-06-06 11:19:40 -04:00
flex-wrap: wrap;
2021-09-03 15:45:07 -07:00
}
.checkboxField label {
display: flex;
align-items: center;
flex-grow: 1;
font-size: var(--font-size-body);
2022-06-06 11:19:40 -04:00
line-height: 24px;
2021-09-03 15:45:07 -07:00
}
.checkboxField input {
2021-12-02 17:21:37 -08:00
outline: 0;
2021-09-03 15:45:07 -07:00
appearance: none;
2021-10-06 16:47:05 -07:00
-webkit-appearance: none;
2021-09-03 15:45:07 -07:00
margin: 0;
padding: 0;
}
.checkbox {
display: inline-flex;
align-items: center;
justify-content: center;
position: relative;
flex-shrink: 0;
height: 16px;
width: 16px;
2021-10-06 16:47:05 -07:00
border: 1.5px solid rgba(185, 190, 198, 0.5);
2021-09-03 15:45:07 -07:00
box-sizing: border-box;
border-radius: 4px;
margin-right: 10px;
}
.checkboxField.disabled,
.checkboxField.disabled .description {
color: var(--cpd-color-text-disabled);
}
.checkboxField.disabled .checkbox {
border-color: var(--cpd-color-border-disabled);
}
2021-09-03 15:45:07 -07:00
.checkbox svg {
display: none;
}
.checkbox svg * {
stroke: var(--stopgap-color-on-solid-accent);
2021-09-03 15:45:07 -07:00
}
.checkboxField input[type="checkbox"]:checked + label > .checkbox {
background: var(--cpd-color-text-action-accent);
border-color: var(--cpd-color-text-action-accent);
2021-09-03 15:45:07 -07:00
}
.checkboxField input[type="checkbox"]:checked + label > .checkbox svg {
display: flex;
}
2021-12-02 17:21:37 -08:00
.checkboxField:focus-within .checkbox {
border: 1.5px solid var(--cpd-color-text-link-external) !important;
2021-12-02 17:21:37 -08:00
}
2021-08-20 16:23:12 -07:00
.errorMessage {
margin: 0;
font-size: var(--font-size-caption);
color: var(--cpd-color-text-critical-primary);
2021-08-20 16:23:12 -07:00
font-weight: 600;
2021-10-06 16:47:05 -07:00
}
2022-06-06 11:19:40 -04:00
.description {
color: var(--cpd-color-text-secondary);
2022-06-06 11:19:40 -04:00
margin-left: 26px;
width: 100%; /* Ensure that it breaks onto the next row */
}
.description.noLabel {
margin-top: -20px; /* Ensures that there is no weired spacing if the checkbox doesn't have a label */
}