stage-browser 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,400 @@
1
+ /* Stage UI: tab capsule + omnibox. System fonts, no assets, 4px grid.
2
+ Theme: tokens use light-dark(); `color-scheme` lives on <body> (not <html>) so the
3
+ transparent view never gets an opaque canvas. [data-theme] on <html> forces a theme. */
4
+
5
+ :root {
6
+ --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
7
+ --mono: ui-monospace, "SF Mono", Menlo, monospace;
8
+
9
+ --surface: light-dark(rgb(247 247 248 / .94), rgb(29 29 32 / .94));
10
+ --panel: light-dark(rgb(250 250 251 / .98), rgb(30 30 33 / .98));
11
+ --border: light-dark(rgb(0 0 0 / .11), rgb(255 255 255 / .11));
12
+ --edge: light-dark(rgb(0 0 0 / .05), rgb(0 0 0 / .55));
13
+ --highlight: light-dark(rgb(255 255 255 / .9), rgb(255 255 255 / .07));
14
+ --text: light-dark(#1d1d1f, #f5f5f7);
15
+ --muted: light-dark(rgb(60 60 67 / .64), rgb(235 235 245 / .58));
16
+ --faint: light-dark(rgb(60 60 67 / .36), rgb(235 235 245 / .32));
17
+ --hover: light-dark(rgb(0 0 0 / .055), rgb(255 255 255 / .075));
18
+ --press: light-dark(rgb(0 0 0 / .09), rgb(255 255 255 / .12));
19
+ --tab-active: light-dark(#fff, rgb(255 255 255 / .125));
20
+ --tab-ring: light-dark(rgb(0 0 0 / .07), rgb(255 255 255 / .07));
21
+ --shadow-c: light-dark(rgb(0 0 0 / .16), rgb(0 0 0 / .5));
22
+ --accent: light-dark(#0a74e6, #4da3ff);
23
+ --accent-soft: light-dark(rgb(10 116 230 / .12), rgb(77 163 255 / .18));
24
+ --kbd-bg: light-dark(rgb(0 0 0 / .06), rgb(255 255 255 / .1));
25
+
26
+ --ease-out: cubic-bezier(.2, .8, .2, 1);
27
+ }
28
+
29
+ *, *::before, *::after { box-sizing: border-box; }
30
+
31
+ html, body {
32
+ margin: 0;
33
+ height: 100%;
34
+ background: transparent;
35
+ overflow: hidden;
36
+ }
37
+
38
+ body {
39
+ color-scheme: light dark;
40
+ font: 400 13px/16px var(--font);
41
+ color: var(--text);
42
+ -webkit-font-smoothing: antialiased;
43
+ -webkit-user-select: none;
44
+ user-select: none;
45
+ cursor: default;
46
+ }
47
+ :root[data-theme="light"] body { color-scheme: light; }
48
+ :root[data-theme="dark"] body { color-scheme: dark; }
49
+
50
+ button { font: inherit; color: inherit; border: 0; background: none; padding: 0; margin: 0; cursor: default; }
51
+ svg { display: block; flex: none; }
52
+ ::selection { background: var(--accent-soft); }
53
+ #omni-input::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
54
+
55
+ :focus { outline: none; }
56
+ :focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
57
+
58
+ /* ---------- strip + capsule ---------- */
59
+
60
+ #strip {
61
+ position: fixed;
62
+ inset: 0 0 auto 0;
63
+ height: 52px;
64
+ padding: 8px 12px 8px 84px; /* 84px reserved for the traffic lights */
65
+ display: flex;
66
+ justify-content: center;
67
+ align-items: flex-start;
68
+ -webkit-app-region: drag;
69
+ pointer-events: none;
70
+ }
71
+
72
+ #capsule {
73
+ display: flex;
74
+ align-items: center;
75
+ gap: 2px;
76
+ height: 36px;
77
+ max-width: 100%;
78
+ min-width: 0;
79
+ padding: 4px;
80
+ border-radius: 12px;
81
+ background: var(--surface);
82
+ border: .5px solid var(--border);
83
+ box-shadow:
84
+ inset 0 .5px 0 var(--highlight),
85
+ 0 0 0 .5px var(--edge),
86
+ 0 1px 2px rgb(0 0 0 / .08),
87
+ 0 4px 12px var(--shadow-c),
88
+ 0 12px 32px -8px var(--shadow-c);
89
+ -webkit-app-region: drag;
90
+
91
+ /* exit: quick and quiet */
92
+ opacity: 0;
93
+ transform: translateY(-10px);
94
+ pointer-events: none;
95
+ transition: opacity 120ms ease-in, transform 120ms ease-in;
96
+ will-change: opacity, transform;
97
+ }
98
+ .bar-visible #capsule {
99
+ opacity: 1;
100
+ transform: none;
101
+ pointer-events: auto;
102
+ transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out);
103
+ }
104
+
105
+ /* every interactive thing opts out of dragging */
106
+ #tabs, #new-tab, #pin, browser-action-list, .tab { -webkit-app-region: no-drag; }
107
+
108
+ #tabs {
109
+ position: relative;
110
+ display: flex;
111
+ gap: 2px;
112
+ height: 28px;
113
+ flex: 0 1 auto;
114
+ min-width: 0;
115
+ overflow-x: auto;
116
+ overflow-y: hidden;
117
+ scrollbar-width: none;
118
+ overscroll-behavior: contain;
119
+ }
120
+ #tabs::-webkit-scrollbar { display: none; }
121
+ #tabs.fade-l { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 20px); mask-image: linear-gradient(90deg, transparent 0, #000 20px); }
122
+ #tabs.fade-r { -webkit-mask-image: linear-gradient(270deg, transparent 0, #000 20px); mask-image: linear-gradient(270deg, transparent 0, #000 20px); }
123
+ #tabs.fade-l.fade-r { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 20px, #000 calc(100% - 20px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 20px, #000 calc(100% - 20px), transparent 100%); }
124
+
125
+ /* ---------- tabs ---------- */
126
+
127
+ .tab {
128
+ --reserve: 0px; /* space under the close button / audio glyph the title fades out before */
129
+ position: relative;
130
+ display: flex;
131
+ align-items: center;
132
+ gap: 8px;
133
+ flex: 0 1 200px;
134
+ min-width: 72px;
135
+ height: 28px;
136
+ padding: 0 8px;
137
+ border-radius: 8px;
138
+ color: var(--muted);
139
+ background: transparent;
140
+ box-shadow: 0 0 0 .5px transparent;
141
+ transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 180ms var(--ease-out);
142
+ }
143
+ .tab:hover { background: var(--hover); color: var(--text); }
144
+ .tab.active {
145
+ color: var(--text);
146
+ background: var(--tab-active);
147
+ box-shadow: 0 0 0 .5px var(--tab-ring), 0 1px 1px rgb(0 0 0 / .05), 0 1px 4px var(--shadow-c);
148
+ }
149
+ .tab.has-aud { --reserve: 20px; }
150
+ .tab:hover, .tab.active { --reserve: 24px; }
151
+ .tab.has-aud:hover, .tab.has-aud.active { --reserve: 44px; }
152
+
153
+ .tab.entering { animation: tab-in 180ms var(--ease-out) both; }
154
+ .tab.closing {
155
+ animation: tab-out 160ms var(--ease-out) both;
156
+ pointer-events: none;
157
+ }
158
+ @keyframes tab-in {
159
+ from { flex-basis: 0px; min-width: 0px; padding-left: 0; padding-right: 0; opacity: 0; }
160
+ }
161
+ @keyframes tab-out {
162
+ to { flex-basis: 0px; min-width: 0px; padding-left: 0; padding-right: 0; opacity: 0; }
163
+ }
164
+
165
+ .tab.dragging {
166
+ z-index: 2;
167
+ transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
168
+ background: var(--tab-active);
169
+ color: var(--text);
170
+ box-shadow: 0 0 0 .5px var(--tab-ring), 0 2px 4px rgb(0 0 0 / .1), 0 8px 20px var(--shadow-c);
171
+ }
172
+ #tabs.no-anim .tab { transition: none; }
173
+
174
+ /* favicon / spinner / monogram share one 16px slot */
175
+ .ico { position: relative; flex: none; width: 16px; height: 16px; }
176
+ .ico > * { position: absolute; inset: 0; display: none; }
177
+ .ico[data-k="img"] .fav,
178
+ .ico[data-k="mono"] .mono,
179
+ .ico[data-k="spin"] .spin,
180
+ .ico[data-k="blank"] .blank { display: block; }
181
+
182
+ .fav { width: 16px; height: 16px; border-radius: 4px; object-fit: contain; -webkit-user-drag: none; }
183
+ .mono {
184
+ --h: 220;
185
+ border-radius: 5px;
186
+ font: 600 10px/16px var(--font);
187
+ text-align: center;
188
+ text-transform: uppercase;
189
+ color: light-dark(hsl(var(--h) 62% 36%), hsl(var(--h) 80% 76%));
190
+ background: light-dark(hsl(var(--h) 70% 50% / .16), hsl(var(--h) 70% 60% / .22));
191
+ }
192
+ .blank { color: var(--faint); }
193
+ .blank svg { width: 16px; height: 16px; }
194
+
195
+ .spin {
196
+ inset: 1px;
197
+ border-radius: 50%;
198
+ border: 1.5px solid var(--faint);
199
+ border-top-color: var(--accent);
200
+ animation: spin 760ms linear infinite;
201
+ }
202
+ @keyframes spin { to { transform: rotate(360deg); } }
203
+
204
+ .title {
205
+ flex: 1 1 auto;
206
+ min-width: 0;
207
+ overflow: hidden;
208
+ white-space: nowrap;
209
+ font-weight: 500;
210
+ letter-spacing: -.003em;
211
+ -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - var(--reserve) - 14px), transparent calc(100% - var(--reserve)));
212
+ mask-image: linear-gradient(90deg, #000 calc(100% - var(--reserve) - 14px), transparent calc(100% - var(--reserve)));
213
+ }
214
+
215
+ .aud {
216
+ position: absolute;
217
+ right: 8px;
218
+ top: 7px;
219
+ width: 14px;
220
+ height: 14px;
221
+ display: none;
222
+ color: var(--muted);
223
+ transition: right 140ms var(--ease-out);
224
+ }
225
+ .has-aud .aud { display: block; }
226
+ .tab:hover .aud, .tab.active .aud { right: 28px; }
227
+ .aud .off { display: none; }
228
+ .aud.is-muted .on { display: none; }
229
+ .aud.is-muted .off { display: block; }
230
+
231
+ .close {
232
+ position: absolute;
233
+ right: 4px;
234
+ top: 4px;
235
+ width: 20px;
236
+ height: 20px;
237
+ border-radius: 6px;
238
+ display: grid;
239
+ place-items: center;
240
+ color: var(--muted);
241
+ opacity: 0;
242
+ pointer-events: none;
243
+ transition: opacity 120ms ease, background-color 120ms ease, color 120ms ease;
244
+ -webkit-app-region: no-drag;
245
+ }
246
+ .tab:hover .close, .tab.active .close, .close:focus-visible { opacity: 1; pointer-events: auto; }
247
+ .close:hover { background: var(--press); color: var(--text); }
248
+
249
+ /* compact: many tabs → favicon-only, the active tab keeps its title */
250
+ #tabs.compact .tab { flex: 0 0 36px; min-width: 36px; padding: 0; justify-content: center; }
251
+ #tabs.compact .tab.active { flex: 0 0 120px; min-width: 120px; padding: 0 8px; justify-content: flex-start; }
252
+ #tabs.compact .tab:not(.active) .title,
253
+ #tabs.compact .tab:not(.active) .aud { display: none; }
254
+ #tabs.compact .tab:not(.active) .close { right: 8px; top: 4px; width: 20px; left: auto; background: var(--hover); backdrop-filter: none; }
255
+ #tabs.compact .tab:not(.active):hover .ico { opacity: 0; }
256
+ #tabs.compact .tab:not(.active) .close { inset: 4px 8px; width: 20px; }
257
+ #tabs.compact .tab.entering { animation-name: tab-in-c; }
258
+ #tabs.compact .tab.closing { animation-name: tab-out; }
259
+ @keyframes tab-in-c { from { flex-basis: 0px; min-width: 0px; opacity: 0; } }
260
+
261
+ /* ---------- trailing controls ---------- */
262
+
263
+ #controls { display: flex; align-items: center; gap: 2px; flex: none; }
264
+ .divider { width: 1px; height: 16px; margin: 0 4px 0 2px; background: var(--border); border-radius: 1px; }
265
+
266
+ .icon-btn {
267
+ flex: none;
268
+ width: 28px;
269
+ height: 28px;
270
+ border-radius: 8px;
271
+ display: grid;
272
+ place-items: center;
273
+ color: var(--muted);
274
+ transition: background-color 120ms ease, color 120ms ease;
275
+ }
276
+ .icon-btn:hover { background: var(--hover); color: var(--text); }
277
+ .icon-btn:active { background: var(--press); }
278
+ #pin[aria-pressed="true"] { color: var(--accent); }
279
+ #pin[aria-pressed="true"] path { fill: currentColor; }
280
+ #pin svg { transition: transform 160ms var(--ease-out); }
281
+ #pin:active svg { transform: scale(.88); }
282
+
283
+ browser-action-list { display: flex; align-items: center; height: 28px; }
284
+ browser-action-list::part(action) {
285
+ width: 24px;
286
+ height: 24px;
287
+ margin: 0 2px;
288
+ padding: 0;
289
+ border: 0;
290
+ border-radius: 6px;
291
+ background-color: transparent;
292
+ }
293
+ browser-action-list::part(action):hover { background-color: var(--hover); }
294
+ browser-action-list::part(action):active { background-color: var(--press); }
295
+ browser-action-list::part(badge) { font: 600 9px/12px var(--font); }
296
+
297
+ /* ---------- omnibox ---------- */
298
+
299
+ #omni { position: fixed; inset: 0; z-index: 10; }
300
+ #omni[hidden] { display: none; }
301
+
302
+ #omni-backdrop {
303
+ position: absolute;
304
+ inset: 0;
305
+ background: rgb(0 0 0 / .2);
306
+ animation: fade-in 140ms ease-out both;
307
+ }
308
+ @keyframes fade-in { from { opacity: 0; } }
309
+
310
+ #omni-panel {
311
+ position: absolute;
312
+ top: 18vh;
313
+ left: 50%;
314
+ width: min(640px, calc(100vw - 48px));
315
+ transform: translateX(-50%);
316
+ border-radius: 14px;
317
+ background: var(--panel);
318
+ border: .5px solid var(--border);
319
+ box-shadow:
320
+ inset 0 .5px 0 var(--highlight),
321
+ 0 0 0 .5px var(--edge),
322
+ 0 2px 6px rgb(0 0 0 / .12),
323
+ 0 24px 64px rgb(0 0 0 / .32);
324
+ overflow: hidden;
325
+ animation: panel-in 160ms var(--ease-out) both;
326
+ }
327
+ @keyframes panel-in {
328
+ from { opacity: 0; transform: translateX(-50%) translateY(-8px) scale(.985); }
329
+ }
330
+
331
+ #omni-field { display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 16px; }
332
+ #omni-glyph { width: 20px; height: 20px; color: var(--muted); display: grid; place-items: center; }
333
+ #omni-glyph svg { width: 20px; height: 20px; }
334
+ #omni-input {
335
+ flex: 1;
336
+ min-width: 0;
337
+ height: 100%;
338
+ border: 0;
339
+ outline: 0;
340
+ background: transparent;
341
+ color: var(--text);
342
+ font: 400 18px/24px var(--font);
343
+ letter-spacing: -.012em;
344
+ caret-color: var(--accent);
345
+ -webkit-user-select: text;
346
+ user-select: text;
347
+ }
348
+ #omni-input::placeholder { color: var(--faint); }
349
+
350
+ #omni-list {
351
+ max-height: calc(100vh - 18vh - 52px - 24px);
352
+ overflow-y: auto;
353
+ padding: 0 6px 6px;
354
+ scrollbar-width: thin;
355
+ }
356
+ #omni-list:not(:empty) { border-top: .5px solid var(--border); padding-top: 6px; }
357
+
358
+ .row {
359
+ display: flex;
360
+ align-items: center;
361
+ gap: 12px;
362
+ height: 40px;
363
+ padding: 0 12px;
364
+ border-radius: 8px;
365
+ }
366
+ .row.sel { background: var(--hover); }
367
+ .row .r-ico { width: 20px; height: 20px; display: grid; place-items: center; color: var(--muted); flex: none; }
368
+ .row .r-ico img { width: 16px; height: 16px; border-radius: 4px; }
369
+ .row .r-ico svg { width: 16px; height: 16px; }
370
+ .row.sel .r-ico { color: var(--text); }
371
+ .row .r-title { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; line-height: 20px; }
372
+ .row .r-url { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--muted); }
373
+ .row .r-url:empty { display: none; }
374
+ .row .r-title:only-of-type { flex: 1; }
375
+ .row .hint { display: none; align-items: center; gap: 6px; flex: none; color: var(--muted); font-size: 12px; margin-left: auto; }
376
+ .row.sel .hint { display: flex; }
377
+ kbd {
378
+ font: 500 11px/18px var(--font);
379
+ min-width: 20px;
380
+ padding: 0 5px;
381
+ text-align: center;
382
+ border-radius: 5px;
383
+ color: var(--muted);
384
+ background: var(--kbd-bg);
385
+ }
386
+ .hint .h-cmd { display: none; align-items: center; gap: 6px; }
387
+ .hint .h-ret { display: flex; align-items: center; gap: 6px; }
388
+ #omni.cmd .row:not(.is-tab) .h-cmd { display: flex; }
389
+ #omni.cmd .row:not(.is-tab) .h-ret { display: none; }
390
+
391
+ /* ---------- reduced motion ---------- */
392
+
393
+ @media (prefers-reduced-motion: reduce) {
394
+ #capsule, .bar-visible #capsule { transform: none; transition: opacity 80ms linear; }
395
+ .tab, .tab.dragging { transition: background-color 80ms linear, color 80ms linear, box-shadow 80ms linear; }
396
+ .tab.entering, .tab.closing, #omni-backdrop, #omni-panel { animation-duration: 1ms; }
397
+ #omni-panel { animation-name: fade-in; }
398
+ .aud, #pin svg, .close { transition: none; }
399
+ .spin { animation-duration: 1.6s; }
400
+ }