@nsnanocat/preference-panes 1.3.0 → 1.3.1

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.
@@ -26,8 +26,6 @@
26
26
  width: 100%;
27
27
  max-width: 100vw;
28
28
  min-width: 0;
29
- height: 100vh;
30
- overflow: hidden;
31
29
  }
32
30
 
33
31
  :root[data-theme="dark"] {
@@ -43,30 +41,6 @@
43
41
  box-sizing: border-box;
44
42
  letter-spacing: 0;
45
43
  }
46
- .pp-header {
47
- flex: none;
48
- height: calc(52px + env(safe-area-inset-top));
49
- padding: env(safe-area-inset-top) 12px 0;
50
- display: flex;
51
- align-items: center;
52
- background: var(--pp-surface);
53
- border-bottom: 1px solid var(--pp-border);
54
- position: relative;
55
- z-index: 2;
56
- }
57
- .pp-title {
58
- flex: 1;
59
- text-align: center;
60
- font-size: 17px;
61
- font-weight: 500;
62
- margin: 0;
63
- min-width: 0;
64
- overflow-wrap: anywhere;
65
- }
66
- .pp-nav-spacer {
67
- width: 44px;
68
- flex: none;
69
- }
70
44
  .pp-panel button {
71
45
  font: inherit;
72
46
  cursor: pointer;
@@ -74,41 +48,21 @@
74
48
  background: none;
75
49
  color: inherit;
76
50
  }
77
- .pp-panel .pp-back {
78
- width: 44px;
79
- height: 44px;
80
- flex: none;
81
- font-size: 34px;
82
- line-height: 32px;
83
- padding: 0;
84
- }
85
51
  .pp-panel button:disabled {
86
52
  opacity: 0.5;
87
53
  cursor: wait;
88
54
  }
89
55
  .pp-viewport {
90
- position: relative;
91
- flex: 1;
92
56
  min-width: 0;
93
- min-height: 0;
94
- overflow: hidden;
95
- }
96
- @supports (height: 100dvh) {
97
- .pp-panel {
98
- height: 100dvh;
99
- }
100
57
  }
101
58
  .pp-fields,
102
59
  .pp-choice-page,
103
60
  .pp-settings-page,
104
61
  .pp-cache-page {
105
- position: absolute;
106
- inset: 0;
62
+ box-sizing: border-box;
107
63
  min-width: 0;
108
- overflow-x: hidden;
109
- overflow-y: auto;
110
- padding: 12px max(16px, calc((100% - 688px) / 2)) calc(28px + env(safe-area-inset-bottom) + var(--pp-keyboard-height, 0px));
111
- scroll-padding-bottom: var(--pp-keyboard-height, 0px);
64
+ padding: calc(12px + var(--pp-host-height)) max(16px, calc((100% - 688px) / 2)) calc(28px + env(safe-area-inset-bottom) + var(--pp-keyboard-height));
65
+ scroll-padding-bottom: var(--pp-keyboard-height);
112
66
  background: var(--pp-background);
113
67
  }
114
68
  .pp-choice-link {
@@ -232,21 +186,8 @@
232
186
  white-space: pre-wrap;
233
187
  overflow-wrap: anywhere;
234
188
  }
235
- .pp-module-info {
236
- display: flex;
237
- gap: 12px;
238
- margin: 12px 0;
239
- }
240
- .pp-module-details {
241
- min-width: 0;
242
- overflow-wrap: anywhere;
243
- }
244
- .pp-module-source {
245
- color: inherit;
246
- text-decoration: underline;
247
- }
248
189
  .pp-status {
249
- position: fixed;
190
+ position: absolute;
250
191
  inset: 0;
251
192
  display: grid;
252
193
  place-content: center;
@@ -297,23 +238,6 @@
297
238
  white-space: pre-wrap;
298
239
  overflow-wrap: anywhere;
299
240
  }
300
- .pp-toast {
301
- pointer-events: none;
302
- position: fixed;
303
- bottom: calc(30px + env(safe-area-inset-bottom));
304
- left: 50%;
305
- transform: translateX(-50%);
306
- max-width: 90vw;
307
- padding: 10px 16px;
308
- border-radius: 8px;
309
- background: #333e;
310
- color: white;
311
- font-size: 13px;
312
- z-index: 20;
313
- }
314
- .pp-toast[data-kind="error"] {
315
- background: #8d2424;
316
- }
317
241
  .pp-panel :focus-visible {
318
242
  outline: 2px solid var(--pp-accent);
319
243
  outline-offset: -2px;
@@ -326,6 +250,7 @@
326
250
  }
327
251
  .pp-page body {
328
252
  margin: 0;
253
+ overflow: hidden;
329
254
  font:
330
255
  16px / 1.5 -apple-system,
331
256
  BlinkMacSystemFont,
@@ -336,72 +261,161 @@
336
261
  }
337
262
  [data-preference-panes-pages] {
338
263
  position: relative;
339
- min-height: calc(100vh - var(--pp-host-height));
264
+ height: 100vh;
340
265
  background: inherit;
266
+ overflow: hidden;
341
267
  }
342
- [data-preference-panes-module-page],
343
- [data-preference-panes-link-page] {
344
- position: fixed;
345
- inset: var(--pp-host-height) 0 0;
346
- background: inherit;
268
+ @supports (height: 100dvh) {
269
+ [data-preference-panes-pages] {
270
+ height: 100dvh;
271
+ }
272
+ }
273
+ .pp-home,
274
+ .pp-module-page,
275
+ .pp-detail,
276
+ .pp-link-page {
277
+ position: absolute;
278
+ inset: 0;
279
+ overflow-x: hidden;
280
+ overflow-y: auto;
281
+ overscroll-behavior: contain;
282
+ background: var(--pp-background);
283
+ }
284
+ .pp-module-page,
285
+ .pp-detail,
286
+ .pp-link-page {
347
287
  z-index: 1;
348
288
  box-shadow: -8px 0 24px #00000014;
349
289
  }
350
- [data-preference-panes-module-page] iframe,
351
- [data-preference-panes-link-page] iframe {
290
+ .pp-link-page {
291
+ top: var(--pp-host-height);
292
+ }
293
+ .pp-link-page iframe {
352
294
  display: block;
353
295
  border: 0;
354
296
  width: 100%;
355
297
  height: 100%;
356
298
  background: inherit;
357
299
  }
358
- [data-module-message] {
359
- position: absolute;
360
- inset: 0;
361
- margin: 0;
362
- padding: 20px;
363
- background: inherit;
364
- }
365
- [data-module-message][hidden] {
366
- display: none;
367
- }
368
300
  .pp-host-header {
369
- position: sticky;
370
- top: 0;
301
+ box-sizing: border-box;
302
+ position: fixed;
303
+ inset: 0 0 auto;
371
304
  z-index: 2;
372
- display: grid;
373
- grid-template-columns: 44px minmax(0, 1fr) 44px;
305
+ display: flex;
374
306
  align-items: center;
375
- min-height: 44px;
376
- padding: env(safe-area-inset-top) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
377
- border-bottom: 1px solid var(--pp-border, #8884);
378
- background: var(--pp-surface, Canvas);
379
- color: var(--pp-accent, Highlight);
380
- font-size: 17px;
307
+ height: calc(64px + env(safe-area-inset-top));
308
+ padding: env(safe-area-inset-top) max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
309
+ border-bottom: 1px solid transparent;
310
+ background: transparent;
311
+ -webkit-backdrop-filter: blur(25px);
312
+ backdrop-filter: blur(25px);
313
+ color: var(--pp-text);
314
+ transition:
315
+ background-color 200ms ease-in-out,
316
+ border-color 200ms ease-in-out;
317
+ }
318
+ .pp-host-header.pp-scrolled {
319
+ background: rgba(255, 255, 255, 0.6);
320
+ border-color: var(--pp-border);
321
+ }
322
+ :root[data-theme="dark"] .pp-host-header.pp-scrolled {
323
+ background: rgba(13, 14, 15, 0.6);
324
+ }
325
+ @media (min-width: 1280px) {
326
+ .pp-host-header {
327
+ padding-right: max(20px, calc((100vw - 1588px) / 2));
328
+ padding-left: max(20px, calc((100vw - 1588px) / 2));
329
+ }
330
+ }
331
+ @media (prefers-reduced-motion: reduce) {
332
+ .pp-host-header {
333
+ transition: none;
334
+ }
335
+ }
336
+ .pp-host-brand {
337
+ display: flex;
338
+ align-items: center;
339
+ flex: 1;
340
+ height: 36px;
341
+ min-width: 0;
342
+ margin-right: 8px;
343
+ }
344
+ .pp-host-brand-link {
345
+ display: flex;
346
+ align-items: center;
347
+ height: 100%;
348
+ min-width: 0;
349
+ max-width: 100%;
350
+ color: inherit;
351
+ text-decoration: none;
352
+ transition: opacity 0.3s;
353
+ }
354
+ .pp-host-brand-link:hover {
355
+ opacity: 0.6;
356
+ }
357
+ .pp-host-logo {
358
+ flex: none;
359
+ min-width: 2rem;
360
+ margin-right: 0.25rem;
361
+ }
362
+ .pp-host-logo img {
363
+ display: block;
364
+ height: 1.6rem;
381
365
  }
382
366
  .pp-host-title {
383
- text-align: center;
384
- color: var(--pp-text, CanvasText);
367
+ min-width: 0;
368
+ text-align: left;
369
+ font-size: 16px;
385
370
  font-weight: 600;
386
371
  overflow: hidden;
387
372
  text-overflow: ellipsis;
388
373
  white-space: nowrap;
389
374
  }
375
+ .pp-host-left {
376
+ display: flex;
377
+ align-items: center;
378
+ justify-content: center;
379
+ flex: none;
380
+ }
381
+ .pp-host-left::after {
382
+ content: "";
383
+ display: inline-block;
384
+ width: 1px;
385
+ height: 24px;
386
+ margin: 0 16px;
387
+ background-color: #0000001f;
388
+ }
389
+ :root[data-theme="dark"] .pp-host-left::after {
390
+ background-color: #5454547a;
391
+ }
392
+ .pp-host-left[hidden] {
393
+ display: none;
394
+ }
390
395
  .pp-host-back {
391
396
  border: 0;
397
+ border-radius: 18px;
392
398
  background: none;
393
399
  color: inherit;
394
- width: 44px;
395
- height: 44px;
400
+ width: 36px;
401
+ height: 36px;
396
402
  padding: 8px;
397
- font:
398
- 32px / 1 -apple-system,
399
- sans-serif;
400
403
  cursor: pointer;
404
+ transition: background-color 0.2s ease-in-out;
401
405
  }
402
- .pp-host-back[hidden] {
403
- visibility: hidden;
406
+ .pp-host-back svg {
404
407
  display: block;
408
+ width: 20px;
409
+ height: 20px;
410
+ fill: none;
411
+ stroke: currentColor;
412
+ stroke-width: 2;
413
+ }
414
+ .pp-host-back:hover {
415
+ background: #f1f1f1;
416
+ }
417
+ :root[data-theme="dark"] .pp-host-back:hover {
418
+ background: #343a46;
405
419
  }
406
420
  .pp-host-toast {
407
421
  position: fixed;
@@ -432,14 +446,7 @@
432
446
  .pp-home {
433
447
  max-width: 1000px;
434
448
  margin: auto;
435
- padding: 24px max(16px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
436
- }
437
- .pp-home-logo {
438
- display: block;
439
- width: 64px;
440
- height: 64px;
441
- margin: 0 auto 24px;
442
- object-fit: contain;
449
+ padding: var(--pp-host-height) max(16px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
443
450
  }
444
451
  .pp-home-entries {
445
452
  display: flex;
@@ -485,6 +492,7 @@
485
492
  background: var(--pp-field);
486
493
  font-size: 32px;
487
494
  line-height: 40px;
495
+ text-align: center;
488
496
  }
489
497
  .pp-home-icon img {
490
498
  display: block;
@@ -1,15 +0,0 @@
1
- <!doctype html>
2
- <html lang="zh-CN" class="pp-page">
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
6
- <meta name="color-scheme" content="light dark">
7
-
8
- <title>Module Preferences</title>
9
-
10
- </head>
11
- <body>
12
- <main id="preferences"></main>
13
- <script type="module" src="/settings/assets/index.mjs?v=1.3.0"></script>
14
- </body>
15
- </html>