@nsnanocat/preference-panes 1.3.0 → 1.3.2

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;
@@ -323,9 +247,11 @@
323
247
  * The landing page reuses form groups and descriptions, with entries wrapping by viewport width. */
324
248
  :root.pp-page {
325
249
  color-scheme: light dark;
250
+ font-size: 16px;
326
251
  }
327
252
  .pp-page body {
328
253
  margin: 0;
254
+ overflow: hidden;
329
255
  font:
330
256
  16px / 1.5 -apple-system,
331
257
  BlinkMacSystemFont,
@@ -336,72 +262,177 @@
336
262
  }
337
263
  [data-preference-panes-pages] {
338
264
  position: relative;
339
- min-height: calc(100vh - var(--pp-host-height));
265
+ height: 100vh;
340
266
  background: inherit;
267
+ overflow: hidden;
341
268
  }
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;
269
+ @supports (height: 100dvh) {
270
+ [data-preference-panes-pages] {
271
+ height: 100dvh;
272
+ }
273
+ }
274
+ .pp-home,
275
+ .pp-module-page,
276
+ .pp-detail,
277
+ .pp-link-page {
278
+ position: absolute;
279
+ inset: 0;
280
+ overflow-x: hidden;
281
+ overflow-y: auto;
282
+ overscroll-behavior: contain;
283
+ background: var(--pp-background);
284
+ }
285
+ .pp-module-page,
286
+ .pp-detail,
287
+ .pp-link-page {
347
288
  z-index: 1;
348
289
  box-shadow: -8px 0 24px #00000014;
349
290
  }
350
- [data-preference-panes-module-page] iframe,
351
- [data-preference-panes-link-page] iframe {
291
+ .pp-link-page {
292
+ top: var(--pp-host-height);
293
+ }
294
+ .pp-link-page iframe {
352
295
  display: block;
353
296
  border: 0;
354
297
  width: 100%;
355
298
  height: 100%;
356
299
  background: inherit;
357
300
  }
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;
301
+ /* 网页导航复用宿主官网已有字体;官网更换字体产物时须同步资源地址。
302
+ * The web navigation reuses the host site's existing font; update the URL when its font artifact changes. */
303
+ @font-face {
304
+ font-family: "SF Pro Display";
305
+ font-style: normal;
306
+ font-weight: 700;
307
+ src:
308
+ local("SF Pro Display"),
309
+ url("/static/font/SFPRODISPLAYBOLD.21a7ca4497.woff2") format("woff2");
367
310
  }
368
311
  .pp-host-header {
369
- position: sticky;
370
- top: 0;
312
+ box-sizing: border-box;
313
+ position: fixed;
314
+ inset: 0 0 auto;
371
315
  z-index: 2;
372
- display: grid;
373
- grid-template-columns: 44px minmax(0, 1fr) 44px;
316
+ display: flex;
374
317
  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;
318
+ height: calc(64px + env(safe-area-inset-top));
319
+ padding: env(safe-area-inset-top) max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
320
+ border-bottom: 1px solid transparent;
321
+ background: transparent;
322
+ -webkit-backdrop-filter: blur(25px);
323
+ backdrop-filter: blur(25px);
324
+ color: var(--pp-text);
325
+ font-family: "SF Pro Display", "Inter var experimental", "Inter var", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
326
+ line-height: 1.7;
327
+ font-synthesis: style;
328
+ text-rendering: optimizelegibility;
329
+ -webkit-font-smoothing: antialiased;
330
+ -moz-osx-font-smoothing: grayscale;
331
+ -webkit-text-size-adjust: 100%;
332
+ transition:
333
+ background-color 200ms ease-in-out,
334
+ border-color 200ms ease-in-out;
335
+ }
336
+ .pp-host-header.pp-scrolled {
337
+ background: rgba(255, 255, 255, 0.6);
338
+ border-color: var(--pp-border);
339
+ }
340
+ :root[data-theme="dark"] .pp-host-header.pp-scrolled {
341
+ background: rgba(13, 14, 15, 0.6);
342
+ }
343
+ @media (min-width: 1280px) {
344
+ .pp-host-header {
345
+ padding-right: max(20px, calc((100vw - 1588px) / 2));
346
+ padding-left: max(20px, calc((100vw - 1588px) / 2));
347
+ }
381
348
  }
382
- .pp-host-title {
383
- text-align: center;
384
- color: var(--pp-text, CanvasText);
349
+ @media (prefers-reduced-motion: reduce) {
350
+ .pp-host-header {
351
+ transition: none;
352
+ }
353
+ }
354
+ .pp-host-brand {
355
+ display: flex;
356
+ align-items: center;
357
+ flex: 1;
358
+ min-width: 0;
359
+ margin-right: 8px;
360
+ }
361
+ .pp-host-brand-link {
362
+ display: flex;
363
+ align-items: center;
364
+ height: 100%;
365
+ min-width: 0;
366
+ max-width: 100%;
367
+ color: inherit;
368
+ text-decoration: none;
369
+ font-size: 1rem;
385
370
  font-weight: 600;
371
+ transition: opacity 0.3s;
372
+ }
373
+ .pp-host-brand-link:hover {
374
+ opacity: 0.6;
375
+ }
376
+ .pp-host-logo {
377
+ flex: none;
378
+ min-width: 2rem;
379
+ margin-right: 0.25rem;
380
+ }
381
+ .pp-host-logo img {
382
+ display: block;
383
+ height: 1.6rem;
384
+ }
385
+ .pp-host-title {
386
+ min-width: 0;
387
+ text-align: left;
386
388
  overflow: hidden;
387
389
  text-overflow: ellipsis;
388
390
  white-space: nowrap;
389
391
  }
392
+ .pp-host-left {
393
+ display: flex;
394
+ align-items: center;
395
+ justify-content: center;
396
+ flex: none;
397
+ }
398
+ .pp-host-left::after {
399
+ content: "";
400
+ display: inline-block;
401
+ width: 1px;
402
+ height: 24px;
403
+ margin: 0 16px;
404
+ background-color: #0000001f;
405
+ }
406
+ :root[data-theme="dark"] .pp-host-left::after {
407
+ background-color: #5454547a;
408
+ }
390
409
  .pp-host-back {
391
410
  border: 0;
411
+ border-radius: 18px;
392
412
  background: none;
393
413
  color: inherit;
394
- width: 44px;
395
- height: 44px;
414
+ width: 36px;
415
+ height: 36px;
396
416
  padding: 8px;
397
- font:
398
- 32px / 1 -apple-system,
399
- sans-serif;
400
417
  cursor: pointer;
418
+ transition: background-color 0.2s ease-in-out;
419
+ }
420
+ .pp-host-back:disabled {
421
+ cursor: default;
401
422
  }
402
- .pp-host-back[hidden] {
403
- visibility: hidden;
423
+ .pp-host-back svg {
404
424
  display: block;
425
+ width: 20px;
426
+ height: 20px;
427
+ fill: none;
428
+ stroke: currentColor;
429
+ stroke-width: 2;
430
+ }
431
+ .pp-host-back:hover {
432
+ background: #f1f1f1;
433
+ }
434
+ :root[data-theme="dark"] .pp-host-back:hover {
435
+ background: #343a46;
405
436
  }
406
437
  .pp-host-toast {
407
438
  position: fixed;
@@ -432,14 +463,7 @@
432
463
  .pp-home {
433
464
  max-width: 1000px;
434
465
  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;
466
+ 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
467
  }
444
468
  .pp-home-entries {
445
469
  display: flex;
@@ -485,6 +509,7 @@
485
509
  background: var(--pp-field);
486
510
  font-size: 32px;
487
511
  line-height: 40px;
512
+ text-align: center;
488
513
  }
489
514
  .pp-home-icon img {
490
515
  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>