2019-01-20 12:11:20 +08: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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* TODO: Consider unifying with general input styles in _dharma.scss */
|
|
|
|
|
|
|
|
.mx_Field {
|
|
|
|
position: relative;
|
|
|
|
margin: 1em 0;
|
|
|
|
}
|
|
|
|
|
2019-01-23 10:25:09 +08:00
|
|
|
.mx_Field input,
|
2019-01-26 11:38:35 +08:00
|
|
|
.mx_Field select,
|
|
|
|
.mx_Field textarea {
|
2019-01-20 12:11:20 +08:00
|
|
|
font-weight: normal;
|
2019-01-25 02:43:03 +08:00
|
|
|
font-family: $font-family;
|
2019-01-31 07:52:18 +08:00
|
|
|
font-size: 14px;
|
2019-01-20 12:11:20 +08:00
|
|
|
border-radius: 4px;
|
|
|
|
transition: border-color 0.25s;
|
|
|
|
border: 1px solid $input-border-color;
|
2019-01-22 00:16:20 +08:00
|
|
|
padding: 8px 9px;
|
2019-01-31 20:09:50 +08:00
|
|
|
background-color: $primary-bg-color;
|
2019-01-20 12:11:20 +08:00
|
|
|
}
|
|
|
|
|
2019-01-31 06:40:53 +08: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;
|
|
|
|
mask: url('$(res)/img/feather-icons/dropdown-arrow.svg');
|
|
|
|
mask-repeat: no-repeat;
|
2019-01-31 20:09:50 +08:00
|
|
|
background-color: $primary-fg-color;
|
2019-01-31 06:40:53 +08:00
|
|
|
z-index: 1;
|
|
|
|
pointer-events: none;
|
|
|
|
}
|
|
|
|
|
2019-01-23 10:25:09 +08:00
|
|
|
.mx_Field input:focus,
|
2019-01-26 11:38:35 +08:00
|
|
|
.mx_Field select:focus,
|
|
|
|
.mx_Field textarea:focus {
|
2019-01-20 12:11:20 +08:00
|
|
|
outline: 0;
|
2019-01-22 00:24:04 +08:00
|
|
|
border-color: $input-focused-border-color;
|
2019-01-20 12:11:20 +08:00
|
|
|
}
|
|
|
|
|
2019-01-26 11:38:35 +08:00
|
|
|
.mx_Field input::placeholder,
|
|
|
|
.mx_Field textarea::placeholder {
|
2019-01-20 12:11:20 +08:00
|
|
|
transition: color 0.25s ease-in 0s;
|
|
|
|
color: transparent;
|
|
|
|
}
|
|
|
|
|
2019-01-26 11:38:35 +08:00
|
|
|
.mx_Field input:placeholder-shown:focus::placeholder,
|
|
|
|
.mx_Field textarea:placeholder-shown:focus::placeholder {
|
2019-01-20 12:11:20 +08: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;
|
|
|
|
font-size: 14px;
|
|
|
|
position: absolute;
|
|
|
|
left: 0px;
|
|
|
|
top: 0px;
|
2019-01-22 00:09:33 +08:00
|
|
|
margin: 7px 8px;
|
2019-01-20 12:11:20 +08:00
|
|
|
padding: 2px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.mx_Field input:focus + label,
|
2019-01-23 10:25:09 +08:00
|
|
|
.mx_Field input:not(:placeholder-shown) + label,
|
2019-01-26 11:38:35 +08:00
|
|
|
.mx_Field textarea:focus + label,
|
|
|
|
.mx_Field textarea:not(:placeholder-shown) + label,
|
2019-01-24 05:43:45 +08:00
|
|
|
.mx_Field select + label /* Always show a select's label on top to not collide with the value */ {
|
2019-01-20 12:11:20 +08: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: 10px;
|
2019-02-05 23:50:56 +08:00
|
|
|
top: -13px;
|
|
|
|
padding: 0 2px;
|
2019-01-20 12:11:20 +08:00
|
|
|
background-color: $field-focused-label-bg-color;
|
|
|
|
}
|
|
|
|
|
2019-01-23 10:25:09 +08:00
|
|
|
.mx_Field input:focus + label,
|
2019-01-26 11:38:35 +08:00
|
|
|
.mx_Field select:focus + label,
|
|
|
|
.mx_Field textarea:focus + label {
|
2019-01-22 00:24:04 +08:00
|
|
|
color: $input-focused-border-color;
|
2019-01-20 12:11:20 +08:00
|
|
|
}
|
2019-01-25 10:27:20 +08:00
|
|
|
|
2019-01-26 00:10:16 +08:00
|
|
|
.mx_Field select:disabled,
|
2019-02-08 02:58:15 +08:00
|
|
|
.mx_Field input:disabled,
|
|
|
|
.mx_Field textarea:disabled,
|
|
|
|
.mx_Field textarea:disabled + label {
|
2019-01-25 10:27:20 +08:00
|
|
|
background-color: $field-focused-label-bg-color;
|
2019-01-26 00:10:16 +08:00
|
|
|
color: $greyed-fg-color;
|
2019-01-25 10:27:20 +08:00
|
|
|
}
|