3. public / libmde / md-filled-text-field.css

1
.md-filled-text-field {
2
 position: relative;
3
 overflow: hidden;
4
 display: flex;
5
 flex-direction: column;
6
 align-items: stretch;
7
 padding-top: calc(0.5rem + var(--md-sys-typescale-body-small-line-height));
8
 border-top-left-radius: var(--md-sys-shape-corner-extra-small-top-top-left);
9
 border-top-right-radius: var(--md-sys-shape-corner-extra-small-top-top-right);
10
 overflow: hidden;
11
}
12
13
/* container */
14
.md-filled-text-field::before {
15
 content: "";
16
 position: absolute;
17
 z-index: -2;
18
 top: 0;
19
 right: 0;
20
 left: 0;
21
 bottom: 0;
22
 background-color: var(--md-sys-color-surface-container-highest);
23
}
24
25
/* state layer */
26
.md-filled-text-field::after {
27
 content: "";
28
 position: absolute;
29
 z-index: -1;
30
 top: 0;
31
 right: 0;
32
 left: 0;
33
 bottom: 0;
34
 background-color: transparent;
35
}
36
37
.md-filled-text-field span,
38
.md-filled-text-field label {
39
 position: absolute;
40
 top: 0.5rem;
41
 left: 1rem;
42
 right: 1rem;
43
 display: block;
44
 transform: translateY(1rem);
45
 transition-property: transform;
46
 transition-duration: var(--md-sys-motion-duration-300);
47
 white-space: nowrap;
48
 text-overflow: ellipsis;
49
 overflow: hidden;
50
 color: var(--md-sys-color-on-surface-variant);
51
 font-family: var(--md-sys-typescale-body-large-font);
52
 font-weight: var(--md-sys-typescale-body-large-weight);
53
 font-size: var(--md-sys-typescale-body-large-size);
54
 font-style: var(--md-sys-typescale-body-large-font-style);
55
 letter-spacing: var(--md-sys-typescale-body-large-tracking);
56
 line-height: var(--md-sys-typescale-body-large-line-height);
57
 text-transform: var(--md-sys-typescale-body-large-text-transform);
58
 text-decoration: var(--md-sys-typescale-body-large-text-decoration);
59
}
60
61
.md-filled-text-field input:not(:placeholder-shown)+span,
62
.md-filled-text-field input:not(:placeholder-shown)+label,
63
.md-filled-text-field textarea:not(:placeholder-shown)+span,
64
.md-filled-text-field textarea:not(:placeholder-shown)+label,
65
.md-filled-text-field .populated+span,
66
.md-filled-text-field .populated+label,
67
.md-filled-text-field:focus-within span,
68
.md-filled-text-field:focus-within label,
69
.md-filled-text-field.float span,
70
.md-filled-text-field.float label {
71
 transform: translateY(0);
72
 font-family: var(--md-sys-typescale-body-small-font);
73
 font-weight: var(--md-sys-typescale-body-small-weight);
74
 font-size: var(--md-sys-typescale-body-small-size);
75
 font-style: var(--md-sys-typescale-body-small-font-style);
76
 letter-spacing: var(--md-sys-typescale-body-small-tracking);
77
 line-height: var(--md-sys-typescale-body-small-line-height);
78
 text-transform: var(--md-sys-typescale-body-small-text-transform);
79
 text-decoration: var(--md-sys-typescale-body-small-text-decoration);
80
}
81
82
.md-filled-text-field :not(label, span, small) {
83
 position: relative;
84
 caret-color: var(--md-sys-color-primary);
85
 min-height: 2rem;
86
 box-sizing: border-box;
87
 padding-left: 1rem;
88
 padding-bottom: 0.5rem;
89
 padding-right: 1rem;
90
 border: none;
91
 resize: none;
92
 color: var(--md-sys-color-on-surface);
93
 font-family: var(--md-sys-typescale-body-large-font);
94
 font-weight: var(--md-sys-typescale-body-large-weight);
95
 font-size: var(--md-sys-typescale-body-large-size);
96
 font-style: var(--md-sys-typescale-body-large-font-style);
97
 letter-spacing: var(--md-sys-typescale-body-large-tracking);
98
 line-height: var(--md-sys-typescale-body-large-line-height);
99
 text-transform: var(--md-sys-typescale-body-large-text-transform);
100
 text-decoration: var(--md-sys-typescale-body-large-text-decoration);
101
 background-color: transparent;
102
 outline: none;
103
 border-bottom-width: 0.0625rem;
104
 border-bottom-style: solid;
105
 border-bottom-color: var(--md-sys-color-on-surface-variant);
106
}
107
108
.md-filled-text-field ::placeholder {
109
 color: transparent;
110
}
111
112
.md-filled-text-field small {
113
 display: block;
114
 color: var(--md-sys-color-on-surface-variant);
115
 background-color: var(--md-sys-color-background);
116
 font-family: var(--md-sys-typescale-body-small-font);
117
 font-weight: var(--md-sys-typescale-body-small-weight);
118
 font-size: var(--md-sys-typescale-body-small-size);
119
 font-style: var(--md-sys-typescale-body-small-font-style);
120
 letter-spacing: var(--md-sys-typescale-body-small-tracking);
121
 line-height: var(--md-sys-typescale-body-small-line-height);
122
 text-transform: var(--md-sys-typescale-body-small-text-transform);
123
 text-decoration: var(--md-sys-typescale-body-small-text-decoration);
124
 padding: 0.25rem 1rem 0 1rem;
125
 white-space: nowrap;
126
 text-overflow: ellipsis;
127
 overflow: hidden;
128
}
129
130
.md-filled-text-field:hover span,
131
.md-filled-text-field:hover label {
132
 color: var(--md-sys-color-on-surface-variant);
133
}
134
135
.md-filled-text-field:hover :not(label, span, small) {
136
 padding-bottom: 0.5rem;
137
 border-bottom-width: 0.0625rem;
138
 border-bottom-color: var(--md-sys-color-on-surface);
139
}
140
141
.md-filled-text-field:hover::after {
142
 background-color: var(--md-sys-color-on-surface);
143
 opacity: var(--md-sys-state-hover-state-layer-opacity);
144
}
145
146
.md-filled-text-field:hover small {
147
 color: var(--md-sys-color-on-surface-variant);
148
}
149
150
.md-filled-text-field:focus-within span,
151
.md-filled-text-field:focus-within label {
152
 color: var(--md-sys-color-primary);
153
}
154
155
.md-filled-text-field :focus {
156
 color: var(--md-sys-color-on-surface);
157
 outline: none;
158
 padding-bottom: 0.4375rem;
159
 border-bottom-width: 0.125rem;
160
 border-bottom-color: var(--md-sys-color-primary);
161
}
162
163
.md-filled-text-field:hover :focus {
164
 padding-bottom: 0.4375rem;
165
 border-bottom-width: 0.125rem;
166
}
167
168
.md-filled-text-field:focus-within small {
169
 color: var(--md-sys-color-on-surface-variant);
170
}
171
172
.md-filled-text-field :invalid {
173
 color: var(--md-sys-color-on-surface);
174
 border-bottom-color: var(--md-sys-color-error);
175
}
176
177
.md-filled-text-field :invalid+span,
178
.md-filled-text-field :invalid+label {
179
 color: var(--md-sys-color-error);
180
}
181
182
.md-filled-text-field :invalid~small,
183
.md-filled-text-field:hover :invalid~small,
184
.md-filled-text-field:focus-within .input-text:invalid~small {
185
 color: var(--md-sys-color-error);
186
}
187
188
.md-filled-text-field :invalid:focus {
189
 caret-color: var(--md-sys-color-error);
190
 border-bottom-color: var(--md-sys-color-error);
191
}
192
193
.md-filled-text-field:hover :invalid {
194
 color: var(--md-sys-color-on-surface);
195
 border-bottom-color: var(--md-sys-color-error);
196
}
skip_previous skip_next