-
-
Notifications
You must be signed in to change notification settings - Fork 84
/
Copy pathtextfield-filled.css
123 lines (112 loc) · 3.76 KB
/
textfield-filled.css
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
.matter-textfield-filled {
--matter-helper-theme: var(--matter-theme-rgb, var(--matter-primary-rgb, 33, 150, 243));
position: relative;
display: inline-block;
font-family: var(--matter-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system);
font-size: 16px;
line-height: 1.5;
}
/* Input, Textarea */
.matter-textfield-filled > input,
.matter-textfield-filled > textarea {
display: block;
box-sizing: border-box;
margin: 0;
border: none;
border-top: solid 24px transparent;
border-bottom: solid 1px rgba(var(--matter-onsurface-rgb, 0, 0, 0), 0.6);
border-radius: 4px 4px 0 0;
padding: 0 12px 7px;
width: 100%;
height: inherit;
color: rgba(var(--matter-onsurface-rgb, 0, 0, 0), 0.87);
-webkit-text-fill-color: currentColor; /* Safari */
background-color: rgba(var(--matter-onsurface-rgb, 0, 0, 0), 0.04);
box-shadow: none; /* Firefox */
font-family: inherit;
font-size: inherit;
line-height: inherit;
caret-color: rgb(var(--matter-helper-theme));
transition: border-bottom 0.2s, background-color 0.2s;
}
/* Span */
.matter-textfield-filled > input + span,
.matter-textfield-filled > textarea + span {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
display: block;
box-sizing: border-box;
padding: 7px 12px 0;
color: rgba(var(--matter-onsurface-rgb, 0, 0, 0), 0.6);
font-size: 75%;
line-height: 18px;
pointer-events: none;
transition: color 0.2s, font-size 0.2s, line-height 0.2s;
}
/* Underline */
.matter-textfield-filled > input + span::after,
.matter-textfield-filled > textarea + span::after {
content: "";
position: absolute;
left: 0;
bottom: 0;
display: block;
width: 100%;
height: 2px;
background-color: rgb(var(--matter-helper-theme));
transform-origin: bottom center;
transform: scaleX(0);
transition: transform 0.3s;
}
/* Hover */
.matter-textfield-filled:hover > input,
.matter-textfield-filled:hover > textarea {
border-bottom-color: rgba(var(--matter-onsurface-rgb, 0, 0, 0), 0.87);
background-color: rgba(var(--matter-onsurface-rgb, 0, 0, 0), 0.08);
}
/* Placeholder-shown */
.matter-textfield-filled > input:not(:focus):placeholder-shown + span,
.matter-textfield-filled > textarea:not(:focus):placeholder-shown + span {
font-size: inherit;
line-height: 48px;
}
/* Focus */
.matter-textfield-filled > input:focus,
.matter-textfield-filled > textarea:focus {
outline: none;
}
.matter-textfield-filled > input:focus + span,
.matter-textfield-filled > textarea:focus + span {
color: rgb(var(--matter-helper-theme));
}
.matter-textfield-filled > input:focus + span::after,
.matter-textfield-filled > textarea:focus + span::after {
transform: scale(1);
}
/* Disabled */
.matter-textfield-filled > input:disabled,
.matter-textfield-filled > textarea:disabled {
border-bottom-color: rgba(var(--matter-onsurface-rgb, 0, 0, 0), 0.38);
color: rgba(var(--matter-onsurface-rgb, 0, 0, 0), 0.38);
background-color: rgba(var(--matter-onsurface-rgb, 0, 0, 0), 0.24);
}
.matter-textfield-filled > input:disabled + span,
.matter-textfield-filled > textarea:disabled + span {
color: rgba(var(--matter-onsurface-rgb, 0, 0, 0), 0.38);
}
/* Faster transition in Safari for less noticable fractional font-size issue */
@media not all and (min-resolution:.001dpcm) {
@supports (-webkit-appearance:none) {
.matter-textfield-filled > input,
.matter-textfield-filled > input + span,
.matter-textfield-filled > input + span::after,
.matter-textfield-filled > textarea,
.matter-textfield-filled > textarea + span,
.matter-textfield-filled > textarea + span::after {
transition-duration: 0.1s;
}
}
}