Use custom appearance and arrow for select fields

pull/21833/head
J. Ryan Stinnett 2019-01-30 16:40:53 -06:00
parent b093119d30
commit d6f55a508c
2 changed files with 21 additions and 1 deletions

View File

@ -32,6 +32,26 @@ limitations under the License.
padding: 8px 9px; padding: 8px 9px;
} }
.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;
background: $primary-fg-color;
z-index: 1;
pointer-events: none;
}
.mx_Field input:focus, .mx_Field input:focus,
.mx_Field select:focus, .mx_Field select:focus,
.mx_Field textarea:focus { .mx_Field textarea:focus {

View File

@ -60,7 +60,7 @@ export default class Field extends React.PureComponent {
const element = this.props.element || "input"; const element = this.props.element || "input";
const fieldInput = React.createElement(element, extraProps, this.props.children); const fieldInput = React.createElement(element, extraProps, this.props.children);
return <div className="mx_Field"> return <div className={`mx_Field mx_Field_${element}`}>
{fieldInput} {fieldInput}
<label htmlFor={this.props.id}>{this.props.label}</label> <label htmlFor={this.props.id}>{this.props.label}</label>
</div>; </div>;