forked from CoreBunch/Instatic
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInput.module.css
More file actions
267 lines (231 loc) · 6.81 KB
/
Copy pathInput.module.css
File metadata and controls
267 lines (231 loc) · 6.81 KB
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
/* Shared form field primitive. */
.input {
width: 100%;
box-sizing: border-box;
background: transparent;
border: 1px solid var(--overlay-20);
border-radius: var(--input-radius);
color: var(--text);
font-family: var(--font-sans);
outline: none;
}
.input:hover {
border-color: var(--overlay-30);
}
.input:focus,
.input:focus-within {
background: transparent;
border-color: var(--overlay-50);
}
.input:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.input::placeholder {
color: var(--text-disabled);
}
.input[data-emphasis="strong"] {
font-weight: 700;
}
.monospace {
font-family: var(--font-mono);
letter-spacing: 0;
}
.size-xs {
min-height: 24px;
padding: var(--space-4xs) var(--space-xs);
font-size: var(--text-xs);
}
.size-sm {
min-height: 28px;
padding: var(--space-2xs) var(--space-s);
font-size: var(--text-xs);
}
.size-md {
min-height: 32px;
padding: var(--space-xs) var(--space-m);
font-size: var(--text-s);
}
.textarea {
resize: vertical;
line-height: 1.5;
}
.textarea[data-resize="none"] {
resize: none;
}
.textarea[data-resize="both"] {
resize: both;
}
.invalid {
border-color: var(--danger);
}
/* ─── Affix wrapper (used when `unit` and/or `numberSpinner` are present) ──
* The wrapper inherits the same border + size tokens as the bare input so
* the unit / spinner controls read as part of the field. The actual
* `<input>` inside the wrapper drops its own border to avoid double frames.
*/
.inputWrapper {
position: relative;
display: inline-flex;
align-items: stretch;
width: 100%;
box-sizing: border-box;
background: transparent;
border: 1px solid var(--overlay-20);
border-radius: var(--input-radius);
color: var(--text);
font-family: var(--font-sans);
overflow: hidden;
/* Override the size-class padding (the wrapper inherits .size-* for its
* min-height + font-size, but the inner input owns the visual padding).
* Without this the wrapper applies padding *and* the input applies
* padding — nesting them and bumping the field's effective height. */
padding: 0;
transition: border-color 120ms ease;
}
.inputWrapper:hover {
border-color: var(--overlay-30);
}
.inputWrapper:focus-within {
background: transparent;
border-color: var(--overlay-50);
}
.inputWrapper[data-disabled="true"] {
opacity: 0.5;
cursor: not-allowed;
}
.inputWithAffix {
flex: 1;
width: auto;
min-width: 0;
/* Wrapper drives the field height — null out the size-class min-height
* here so the input does not push the wrapper taller than a bare
* Input of the same size class. */
min-height: 0;
height: auto;
background: transparent;
border: 0;
border-radius: 0;
/* The wrapper owns the focus ring + hover styles; its child must not
* add an extra border on focus. */
}
.inputWithAffix:hover,
.inputWithAffix:focus,
.inputWithAffix:focus-within {
background: transparent;
border: 0;
}
/* Prefix label — `--`, `$`, `@` etc. Inside the leading edge of
* the wrapper, vertically centered with the input value. We pad the left
* edge here and zero out the input's left padding (via `.inputWithAffix`)
* so the prefix sits flush against the value with no double-padding. */
.prefix {
display: inline-flex;
align-items: center;
flex: 0 0 auto;
/* Left inset matches a normal input's text inset so the prefix sits where
the value would start; no right padding — the input's own small left
padding (.inputWithAffix[data-prefixed]) supplies one space to the
value, so prefix + value read as one continuous string. */
padding: 0 0 0 var(--space-s);
color: var(--text-subtle);
font-size: inherit;
font-variant-numeric: tabular-nums;
pointer-events: none;
user-select: none;
}
/* A single space between the prefix and the value / placeholder. */
.inputWithAffix[data-prefixed='true'] {
padding-left: var(--space-3xs);
}
/* Unit suffix label — `px`, `rem`, `%` etc. Inside the trailing edge of
* the wrapper, vertically centered with the input value. The input itself
* owns its right-padding so the value already has breathing room before
* the unit; we only add a small right-padding here as a buffer to the
* spinner column or the wrapper's right edge. */
.unit {
display: inline-flex;
align-items: center;
flex: 0 0 auto;
padding: 0 var(--space-xs) 0 0;
color: var(--text-subtle);
font-size: inherit;
font-variant-numeric: tabular-nums;
pointer-events: none;
user-select: none;
}
/* Generic trailing slot — caller-provided affordance rendered inside the
* trailing edge of the wrapper (e.g. an enter-key submit icon button on a
* picker input). Stays vertically centered and inherits muted text color
* so plain icons read consistently with prefix / unit. The slot itself is
* a wrapper, not a control — it still allows pointer events on its
* children so embedded buttons remain clickable. */
.trailingSlot {
display: inline-flex;
align-items: center;
justify-content: center;
flex: 0 0 auto;
padding: 0 var(--space-3xs) 0 0;
color: var(--text-subtle);
}
/* Custom number-input spinner — replaces the browser-default ugly arrows
* with two compact chevron buttons stacked vertically on the trailing
* edge. Uses our editor tokens so it matches the rest of the chrome. */
.spinner {
display: flex;
flex: 0 0 auto;
flex-direction: column;
border-left: 1px solid var(--overlay-20);
background: var(--overlay-5);
}
.inputWrapper:focus-within .spinner {
border-left-color: var(--overlay-50);
}
.spinnerButton {
appearance: none;
display: flex;
align-items: center;
justify-content: center;
flex: 1;
width: 18px;
min-height: 0;
padding: 0;
border: 0;
background: transparent;
color: var(--text-subtle);
cursor: pointer;
transition: background 120ms ease, color 120ms ease;
}
/* The increase button reuses the (down) chevron-2 glyph, flipped. */
.spinnerIconUp {
transform: rotate(180deg);
}
.spinnerButton + .spinnerButton {
border-top: 1px solid var(--overlay-20);
}
.inputWrapper:focus-within .spinnerButton + .spinnerButton {
border-top-color: var(--overlay-50);
}
.spinnerButton:hover {
background: var(--overlay-5);
color: var(--text);
}
.spinnerButton:active {
background: var(--overlay-10);
}
.spinnerButton:disabled {
cursor: not-allowed;
opacity: 0.4;
}
/* Hide the browser-native number-input spinner so our custom one is the
* only set of controls visible. */
.numberNoSpinner {
appearance: textfield;
-moz-appearance: textfield;
}
.numberNoSpinner::-webkit-outer-spin-button,
.numberNoSpinner::-webkit-inner-spin-button {
appearance: none;
-webkit-appearance: none;
margin: 0;
}