-
Notifications
You must be signed in to change notification settings - Fork 941
/
Copy path_input.scss
91 lines (74 loc) · 1.89 KB
/
_input.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
//
// Copyright 2021 Google LLC
// SPDX-License-Identifier: Apache-2.0
//
@mixin styles() {
.input-wrapper {
display: flex;
}
.input-wrapper > * {
// Inherit field CSS set on the input wrapper, like font, but not margin or
// padding. This wrapper is needed since text fields may have prefix and
// suffix text next to an <input>
all: inherit;
padding: 0;
}
.input {
caret-color: var(--_caret-color);
// remove extra height added by horizontal scrollbars
overflow-x: hidden;
text-align: inherit;
&::placeholder {
color: currentColor;
opacity: 1;
}
// Remove built-in datepicker icon on Chrome
&::-webkit-calendar-picker-indicator {
display: none;
}
// Remove built-in search icons on Chrome when type='search'
&::-webkit-search-decoration,
&::-webkit-search-cancel-button {
display: none;
}
@media (forced-colors: active) {
background: none; // Remove background in Firefox HCM
}
}
// Optionally remove number input's spinner
.no-spinner .input {
&::-webkit-inner-spin-button,
&::-webkit-outer-spin-button {
display: none;
}
&[type='number'] {
-moz-appearance: textfield;
}
}
:focus-within .input {
caret-color: var(--_focus-caret-color);
}
.error:focus-within .input {
caret-color: var(--_error-focus-caret-color);
}
.text-field:not(.disabled) .prefix {
color: var(--_input-text-prefix-color);
}
.text-field:not(.disabled) .suffix {
color: var(--_input-text-suffix-color);
}
.text-field:not(.disabled) .input::placeholder {
color: var(--_input-text-placeholder-color);
}
.prefix,
.suffix {
text-wrap: nowrap;
width: min-content;
}
.prefix {
padding-inline-end: var(--_input-text-prefix-trailing-space);
}
.suffix {
padding-inline-start: var(--_input-text-suffix-leading-space);
}
}