2019-01-20 07:11:20 +03:00
|
|
|
/*
|
|
|
|
Copyright 2019 New Vector Ltd
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2019-02-13 12:45:20 +03:00
|
|
|
/* TODO: Consider unifying with general input styles in _light.scss */
|
2019-01-20 07:11:20 +03:00
|
|
|
|
|
|
|
.mx_Field {
|
2019-03-05 18:13:12 +03:00
|
|
|
display: flex;
|
2019-06-17 19:29:03 +03:00
|
|
|
flex: 1;
|
|
|
|
min-width: 0;
|
2019-01-20 07:11:20 +03:00
|
|
|
position: relative;
|
|
|
|
margin: 1em 0;
|
2019-03-01 19:45:33 +03:00
|
|
|
border-radius: 4px;
|
|
|
|
transition: border-color 0.25s;
|
|
|
|
border: 1px solid $input-border-color;
|
2019-01-20 07:11:20 +03:00
|
|
|
}
|
|
|
|
|
2019-03-05 18:13:12 +03:00
|
|
|
.mx_Field_prefix {
|
|
|
|
border-right: 1px solid $input-border-color;
|
|
|
|
}
|
|
|
|
|
2019-09-20 18:45:14 +03:00
|
|
|
.mx_Field_postfix {
|
|
|
|
border-left: 1px solid $input-border-color;
|
|
|
|
}
|
|
|
|
|
2019-01-23 05:25:09 +03:00
|
|
|
.mx_Field input,
|
2019-01-26 06:38:35 +03:00
|
|
|
.mx_Field select,
|
|
|
|
.mx_Field textarea {
|
2019-01-20 07:11:20 +03:00
|
|
|
font-weight: normal;
|
2019-01-24 21:43:03 +03:00
|
|
|
font-family: $font-family;
|
2020-03-31 17:26:23 +03:00
|
|
|
font-size: $font-14px;
|
2019-03-01 19:45:33 +03:00
|
|
|
border: none;
|
|
|
|
// Even without a border here, we still need this avoid overlapping the rounded
|
|
|
|
// corners on the field above.
|
2019-01-20 07:11:20 +03:00
|
|
|
border-radius: 4px;
|
2019-01-21 19:16:20 +03:00
|
|
|
padding: 8px 9px;
|
2019-02-12 18:40:06 +03:00
|
|
|
color: $primary-fg-color;
|
2019-01-31 15:09:50 +03:00
|
|
|
background-color: $primary-bg-color;
|
2019-06-14 01:48:47 +03:00
|
|
|
flex: 1;
|
2019-11-15 17:37:43 +03:00
|
|
|
min-width: 0;
|
2019-01-20 07:11:20 +03:00
|
|
|
}
|
|
|
|
|
2019-01-31 01:40:53 +03:00
|
|
|
.mx_Field select {
|
|
|
|
-moz-appearance: none;
|
|
|
|
-webkit-appearance: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Can't add pseudo-elements to a select directly, so we use its parent.
|
|
|
|
.mx_Field_select::before {
|
|
|
|
content: "";
|
|
|
|
position: absolute;
|
|
|
|
top: 15px;
|
|
|
|
right: 10px;
|
|
|
|
width: 10px;
|
|
|
|
height: 6px;
|
2019-02-27 13:42:05 +03:00
|
|
|
mask: url('$(res)/img/feather-customised/dropdown-arrow.svg');
|
2019-01-31 01:40:53 +03:00
|
|
|
mask-repeat: no-repeat;
|
2019-01-31 15:09:50 +03:00
|
|
|
background-color: $primary-fg-color;
|
2019-01-31 01:40:53 +03:00
|
|
|
z-index: 1;
|
|
|
|
pointer-events: none;
|
|
|
|
}
|
|
|
|
|
2019-03-01 19:45:33 +03:00
|
|
|
.mx_Field:focus-within {
|
|
|
|
border-color: $input-focused-border-color;
|
|
|
|
}
|
|
|
|
|
2019-01-23 05:25:09 +03:00
|
|
|
.mx_Field input:focus,
|
2019-01-26 06:38:35 +03:00
|
|
|
.mx_Field select:focus,
|
|
|
|
.mx_Field textarea:focus {
|
2019-01-20 07:11:20 +03:00
|
|
|
outline: 0;
|
|
|
|
}
|
|
|
|
|
2019-01-26 06:38:35 +03:00
|
|
|
.mx_Field input::placeholder,
|
|
|
|
.mx_Field textarea::placeholder {
|
2019-01-20 07:11:20 +03:00
|
|
|
transition: color 0.25s ease-in 0s;
|
|
|
|
color: transparent;
|
|
|
|
}
|
|
|
|
|
2019-01-26 06:38:35 +03:00
|
|
|
.mx_Field input:placeholder-shown:focus::placeholder,
|
|
|
|
.mx_Field textarea:placeholder-shown:focus::placeholder {
|
2019-01-20 07:11:20 +03:00
|
|
|
transition: color 0.25s ease-in 0.1s;
|
|
|
|
color: $greyed-fg-color;
|
|
|
|
}
|
|
|
|
|
|
|
|
.mx_Field label {
|
|
|
|
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: $primary-fg-color;
|
|
|
|
background-color: transparent;
|
2020-03-31 17:26:23 +03:00
|
|
|
font-size: $font-14px;
|
2019-01-20 07:11:20 +03:00
|
|
|
position: absolute;
|
|
|
|
left: 0px;
|
|
|
|
top: 0px;
|
2019-01-21 19:09:33 +03:00
|
|
|
margin: 7px 8px;
|
2019-01-20 07:11:20 +03:00
|
|
|
padding: 2px;
|
2019-02-27 16:23:45 +03:00
|
|
|
pointer-events: none; // Allow clicks to fall through to the input
|
2019-03-04 15:02:23 +03:00
|
|
|
overflow: hidden;
|
|
|
|
white-space: nowrap;
|
|
|
|
text-overflow: ellipsis;
|
2019-03-05 14:13:37 +03:00
|
|
|
max-width: calc(100% - 20px); // 100% of parent minus margin and padding
|
2019-01-20 07:11:20 +03:00
|
|
|
}
|
|
|
|
|
2019-07-10 18:55:03 +03:00
|
|
|
.mx_Field_labelAlwaysTopLeft label,
|
2019-07-11 15:14:20 +03:00
|
|
|
.mx_Field select + label /* Always show a select's label on top to not collide with the value */,
|
2019-01-20 07:11:20 +03:00
|
|
|
.mx_Field input:focus + label,
|
2019-01-23 05:25:09 +03:00
|
|
|
.mx_Field input:not(:placeholder-shown) + label,
|
2019-01-26 06:38:35 +03:00
|
|
|
.mx_Field textarea:focus + label,
|
2019-07-10 18:55:03 +03:00
|
|
|
.mx_Field textarea:not(:placeholder-shown) + label {
|
2019-01-20 07:11:20 +03: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;
|
2020-03-31 17:26:23 +03:00
|
|
|
font-size: $font-10px;
|
2019-02-05 18:50:56 +03:00
|
|
|
top: -13px;
|
|
|
|
padding: 0 2px;
|
2019-01-20 07:11:20 +03:00
|
|
|
background-color: $field-focused-label-bg-color;
|
2019-02-27 16:23:45 +03:00
|
|
|
pointer-events: initial;
|
2019-01-20 07:11:20 +03:00
|
|
|
}
|
|
|
|
|
2019-01-23 05:25:09 +03:00
|
|
|
.mx_Field input:focus + label,
|
2019-01-26 06:38:35 +03:00
|
|
|
.mx_Field select:focus + label,
|
|
|
|
.mx_Field textarea:focus + label {
|
2019-01-21 19:24:04 +03:00
|
|
|
color: $input-focused-border-color;
|
2019-01-20 07:11:20 +03:00
|
|
|
}
|
2019-01-25 05:27:20 +03:00
|
|
|
|
2019-01-25 19:10:16 +03:00
|
|
|
.mx_Field select:disabled,
|
2019-02-08 19:52:14 +03:00
|
|
|
.mx_Field select:disabled + label,
|
2019-02-07 21:58:15 +03:00
|
|
|
.mx_Field input:disabled,
|
2019-02-08 19:52:14 +03:00
|
|
|
.mx_Field input:disabled + label,
|
2019-02-07 21:58:15 +03:00
|
|
|
.mx_Field textarea:disabled,
|
|
|
|
.mx_Field textarea:disabled + label {
|
2019-01-25 05:27:20 +03:00
|
|
|
background-color: $field-focused-label-bg-color;
|
2019-01-25 19:10:16 +03:00
|
|
|
color: $greyed-fg-color;
|
2019-01-25 05:27:20 +03:00
|
|
|
}
|
2019-03-05 18:16:07 +03:00
|
|
|
|
2019-03-07 17:16:39 +03:00
|
|
|
.mx_Field_valid {
|
|
|
|
&.mx_Field,
|
|
|
|
&.mx_Field:focus-within {
|
|
|
|
border-color: $input-valid-border-color;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.mx_Field label,
|
|
|
|
&.mx_Field:focus-within label {
|
|
|
|
color: $input-valid-border-color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.mx_Field_invalid {
|
|
|
|
&.mx_Field,
|
|
|
|
&.mx_Field:focus-within {
|
|
|
|
border-color: $input-invalid-border-color;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.mx_Field label,
|
|
|
|
&.mx_Field:focus-within label {
|
|
|
|
color: $input-invalid-border-color;
|
|
|
|
}
|
2019-02-01 02:36:19 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
.mx_Field_tooltip {
|
|
|
|
margin-top: -12px;
|
|
|
|
margin-left: 4px;
|
2019-04-23 18:35:11 +03:00
|
|
|
width: 200px;
|
2019-02-01 02:36:19 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
.mx_Field_tooltip.mx_Field_valid {
|
|
|
|
animation: mx_fadeout 1s 2s forwards;
|
|
|
|
}
|
|
|
|
|
2019-03-05 18:16:07 +03:00
|
|
|
// Customise other components when placed inside a Field
|
|
|
|
|
|
|
|
.mx_Field .mx_Dropdown_input {
|
|
|
|
border: initial;
|
|
|
|
border-radius: initial;
|
|
|
|
}
|
|
|
|
|
|
|
|
.mx_Field .mx_CountryDropdown {
|
2020-07-16 17:45:28 +03:00
|
|
|
width: $font-78px;
|
2019-03-05 18:16:07 +03:00
|
|
|
}
|