-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstyles.css
More file actions
683 lines (601 loc) · 17.8 KB
/
styles.css
File metadata and controls
683 lines (601 loc) · 17.8 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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
/*
* CutMark - Styles
* Copyright (c) 2025 stechdrive
* Released under the MIT license
*/
/* ============================================================================
* CutMark - styles.css (UXP / Photoshop)
* 目的:
* - 役割別の幅ポリシー(広幅: select(使用テンプレ/フォント)、狭幅: 数値/短文入力)
* - px に依存せず em で制御(UXP は ch 非対応のため未使用)
* - フォーカス可視性: クリック等では落ち着いた見た目、キーボード操作時は :focus-visible で明示
* ========================================================================== */
/* ---- トークン ------------------------------------------------------------- */
:root {
--cm-bg: var(--uxp-host-background-color);
--cm-fg: var(--uxp-host-text-color);
--cm-fg-secondary: var(--uxp-host-text-color-secondary, #9aa0a6);
--cm-border: var(--uxp-host-border-color);
--cm-focus: var(--uxp-host-link-text-color);
--cm-radius: 4px;
--cm-gap: 2px;
/* トップバーの高さ(常時表示エリア) */
--cm-topbar-h: 24px;
/* 数値/短文入力の幅ポリシー(相対のみ / ch は使わない) */
/* 1桁の見かけ幅を em で近似(等幅数字前提で 0.55〜0.62em が目安) */
--cm-digit-em: 0.58em;
/* 表示したい桁数(例: 4) */
--cm-num-digits: 4;
/* 左右内側余白見込み(パディング/ボーダー相当を含めた相対値) */
--cm-num-pad-inline: 0.9em;
/* 下限/上限(強すぎると“変えても動かない”ので緩めに設定) */
--cm-num-min: 4.2em;
--cm-num-max: 12em;
}
/* ---- ベース --------------------------------------------------------------- */
html,
body {
height: 100%;
}
body {
margin: 0;
color: var(--cm-fg);
background: var(--cm-bg);
font-size: var(--uxp-host-font-size);
line-height: 1.4;
}
*,
*::before,
*::after {
box-sizing: border-box;
}
sp-theme {
display: block;
height: 100%;
}
#scrollRoot {
height: calc(100% - var(--cm-topbar-h));
padding: 8px;
overflow: auto;
}
/* ---- セクション/フィールドセット ----------------------------------------- */
.section,
.fieldset {
margin: 2px 0;
padding: 2px;
border: 1px solid var(--cm-border);
border-radius: var(--cm-radius);
background: transparent;
min-width: 0;
}
.section>h2,
.section>.section-title,
.fieldset>legend {
margin: 0 0 2px;
font-size: 12px;
color: var(--cm-fg);
}
/* ---- ボタン --------------------------------------------------------------- */
button {
appearance: none;
-webkit-appearance: none;
border: 1px solid var(--cm-border);
background: transparent;
color: var(--cm-fg);
padding: 2px 2px;
border-radius: var(--cm-radius);
cursor: pointer;
max-width: 100%;
/* ▼ Flex 子でも“伸びない”ことをデフォルト化 */
flex-grow: 0;
}
button:hover:not([disabled]) {
background: var(--uxp-host-widget-hover-background-color);
color: var(--uxp-host-widget-hover-text-color);
}
button[disabled] {
/* テーマ変数を使わず、強制的に「半透明のグレー」にする */
/* #808080 は中間色なので、ダーク(白文字)でもライト(黒文字)でもそこそこ見えます */
color: #808080 !important;
border-color: transparent !important;
background-color: transparent !important;
opacity: 0.5 !important;
cursor: default;
pointer-events: none;
}
/* ---- 入力系(テーマ準拠) ------------------------------------------------ */
input[type="text"],
input[type="number"],
input[type="search"],
input[type="password"],
select,
textarea {
appearance: none;
-webkit-appearance: none;
-moz-appearance: none;
background-color: var(--cm-bg);
color: var(--cm-fg);
border: 1px solid var(--cm-border);
border-radius: var(--cm-radius);
padding: 2px 2px;
min-height: 12px;
max-width: 100%;
}
/* === フォーカス可視性ポリシー ============================================= */
/* クリック等(マウス/ペン)での :focus は“控えめ”に(リングは出さない) */
:where(button, input, select, textarea):focus:not(:focus-visible) {
outline: none !important;
box-shadow: none !important;
border-color: var(--cm-border) !important;
}
/* キーボード操作時は :focus-visible で明示(見失わない) */
:where(button, input, select, textarea):focus-visible,
sp-picker:focus-visible {
outline: 2px solid var(--cm-focus);
outline-offset: 2px;
/* 影でコントラストを少し補助(UXPテーマ準拠色) */
box-shadow: 0 0 0 2px var(--cm-focus);
border-color: var(--cm-focus);
}
/* Firefox 独自のリングを抑制(:focus-visible で代替する前提) */
:where(input, select, textarea):-moz-focusring {
outline: none !important;
box-shadow: none !important;
border-color: var(--cm-border) !important;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
input[type="number"] {
-moz-appearance: textfield;
}
input::placeholder,
textarea::placeholder {
color: var(--cm-fg-secondary);
opacity: 1;
}
select {
padding-right: 22px;
}
/* ---- 行(Rows) ------------------------------------------------------------ */
.row {
display: flex;
align-items: center;
gap: var(--cm-gap);
flex-wrap: wrap;
/* 狭幅時は折返し */
min-width: 0;
justify-content: flex-start !important;
}
.row>* {
min-width: 0;
}
.row label {
white-space: nowrap;
flex: 0 0 auto;
}
.row.row-compact {
flex-wrap: nowrap;
gap: 4px;
}
.row.row-compact .pair {
flex: 0 0 auto;
gap: 6px;
}
.row.row-compact .pair:last-child {
margin-left: 8px;
}
.row.row-compact.font-picker-row {
flex-wrap: wrap; /* フォント名とサイズが狭幅時に折り返せるようにする */
}
/* ============================================================================
* 幅ポリシー(役割別)
* ========================================================================== */
/* [A] 広幅を維持する select:使用テンプレ / フォント */
#tplSelect,
#tplFontSel {
flex: 0 1 12em;
min-width: 6em;
max-width: 100%;
width: auto;
}
.visually-hidden {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
border: 0;
clip: rect(0 0 0 0);
overflow: hidden;
display: none; /* ドロップダウンUIを完全に非表示にする */
}
.font-picker-row {
align-items: center;
gap: 12px;
}
.font-inline {
display: flex;
align-items: center;
gap: 8px;
}
.font-display {
font-weight: 600;
}
.font-chooser {
margin-top: 8px;
}
.font-chooser summary {
cursor: pointer;
font-weight: 600;
outline: none;
}
.font-chooser-body {
padding: 8px 0;
display: flex;
flex-direction: column;
gap: 6px;
}
.font-list {
list-style: none;
margin: 0;
padding: 4px;
max-height: 320px;
overflow-y: auto;
border: 1px solid var(--uxp-host-border-color, #444);
border-radius: 4px;
background: var(--uxp-host-background-color, #1e1e1e);
}
.font-list li {
padding: 6px 8px;
cursor: pointer;
border-radius: 3px;
}
.font-list li:hover {
background: rgba(255,255,255,0.08);
}
.font-list li.is-active {
background: rgba(128,180,255,0.20);
}
.font-list-panel {
flex-direction: column;
gap: 6px;
}
.font-list-ctrl {
display: flex;
align-items: center;
gap: 8px;
}
.font-list-status {
font-size: 12px;
color: var(--uxp-host-text-color, #ccc);
}
.font-list {
list-style: none;
margin: 0;
padding: 4px;
max-height: 320px;
overflow-y: auto;
border: 1px solid var(--uxp-host-border-color, #444);
border-radius: 4px;
background: var(--uxp-host-background-color, #1e1e1e);
}
.font-list li {
padding: 6px 8px;
cursor: pointer;
border-radius: 3px;
}
.font-list li:hover {
background: rgba(255,255,255,0.08);
}
.font-list li.is-active {
background: rgba(128,180,255,0.20);
}
/* [B] 狭幅に統一:.row 内の number & 短文 text(px不使用・flex-basis直指定)
- 1桁幅を em で近似(--cm-digit-em)× 桁数(--cm-num-digits)
- → flex-basis = 桁幅合算 + 内側余白見込み
- min/max は em で緩く制限
*/
.row input[type="number"],
.row input[type="text"]:not(#tplName) {
font-variant-numeric: tabular-nums;
font-feature-settings: "tnum" 1;
/* basis 優先で確実に効かせる(grow/shrink は 0) */
flex: 0 0 auto;
flex-basis: calc(var(--cm-num-digits) * var(--cm-digit-em) + var(--cm-num-pad-inline));
min-width: var(--cm-num-min);
max-width: var(--cm-num-max);
}
/* “label直後”パターンも確実に上書き(特異性合わせ) */
.row>label+input[type="number"],
.pair>label+input[type="number"],
.row>label+input[type="text"]:not(#tplName),
.pair>label+input[type="text"]:not(#tplName) {
font-variant-numeric: tabular-nums;
font-feature-settings: "tnum" 1;
flex: 0 0 auto;
flex-basis: calc(var(--cm-num-digits) * var(--cm-digit-em) + var(--cm-num-pad-inline));
min-width: var(--cm-num-min);
max-width: var(--cm-num-max);
}
/* DPI / 行数だけは共通幅ポリシーを緩めて詰める */
.row #tplDpi,
.row #tplRows {
flex: 0 1 auto;
flex-basis: auto;
width: 3.5em;
min-width: 2.8em;
}
/* ---- ペア(label+control の塊) ------------------------------------------- */
.pair {
display: inline-flex;
align-items: center;
gap: 2px;
white-space: nowrap;
/* ラベルと入力の物理分断は避ける */
flex: 0 1 auto;
min-width: 0;
}
.row.row-compact .pair {
gap: 4px;
}
.pair>label {
white-space: nowrap;
flex: 0 0 auto;
}
/* ============================================================================
* 修正:新規テンプレ作成カード「1コマ目:X/Y/W/H」の入力幅を詰める
* ========================================================================== */
.xywh-pair input[type="number"] {
/* 汎用ルールを上書きし、幅をより小さく設定 */
flex-basis: auto;
/* flex-basis の計算をリセット */
width: 4.5em;
/* 幅を小さく固定(emはフォントサイズに依存する相対単位) */
min-width: 3em;
/* 最小幅も小さくする */
}
/* ---- ステッパ(−/+) --------------------------------------------------- */
.stepper {
display: inline-flex;
gap: 4px;
}
.stepper>button {
/* 幅と高さを同じ値にして正方形にする */
width: 2.2em;
height: 2.2em;
padding: 0;
/* パディングをなくす */
line-height: 1.8em;
/* テキストを垂直中央に揃える */
text-align: center;
/* テキストを水平中央に揃える */
min-width: 0;
}
/* ---- 「nコマ目」ボタン等 -------------------------------------------------- */
.place-actions,
#placeButtons {
display: flex;
flex-wrap: wrap;
gap: var(--cm-gap);
margin: 8px 0 12px;
}
/* 以前の伸長指定(flex: 1 1 96px; / min-width: 96px;)は削除 */
/* ---- アコーディオン(SWC) ------------------------------------------------ */
sp-accordion {
display: block;
margin: 0 0 2px;
border: none;
}
sp-accordion-item {
--spectrum-accordion-item-header-background-color: transparent;
--spectrum-accordion-item-divider-thickness: 0;
}
sp-accordion-item::part(header),
sp-accordion-item::part(heading) {
background: transparent !important;
border: none !important;
border-radius: 0 !important;
padding: 2px 2px !important;
color: var(--cm-fg) !important;
}
sp-accordion-item::part(chevron) {
margin-right: 2px !important;
color: var(--cm-fg-secondary);
}
/* ---- <details> 互換 ------------------------------------------------------- */
details.accordion summary {
list-style: none;
display: flex;
align-items: center;
gap: 6px;
padding: 4px 6px;
cursor: pointer;
}
details.accordion summary::-webkit-details-marker {
display: none;
}
details.accordion summary::before {
content: "▸";
color: var(--cm-fg-secondary);
}
details.accordion[open] summary::before {
content: "▾";
}
/* ---- ステータス/ユーティリティ ------------------------------------------- */
#status,
#progress {
color: var(--cm-fg-secondary);
}
#outFolderLabel {
display: inline-block;
max-width: 100%;
overflow-wrap: anywhere;
word-break: break-word;
}
.muted {
color: var(--cm-fg-secondary);
}
.col {
display: flex;
flex-direction: column;
gap: 6px;
}
/* ============================================================================
* 新規テンプレ作成カード「1コマ目:X/Y/W/H」
* 固定幅は廃止。共通ポリシー(上記[B])に従う。
* ========================================================================== */
.row.xywh-row {
flex-wrap: wrap;
gap: var(--cm-gap);
align-items: center;
}
.xywh-title {
flex: 0 0 auto;
white-space: nowrap;
margin-right: 2px;
}
.xywh-pair {
display: inline-flex;
align-items: center;
gap: 6px;
flex: 0 1 auto;
min-width: 0;
}
/* ---- 密度レスポンシブ ----------------------------------------------------- */
@media (max-width: 420px) {
:root {
--cm-gap: 2px;
}
.section {
padding: 2px;
}
button {
padding: 2px 2px;
}
}
/* === CutMark: Modal/Overlay fine-tuning (optional) === */
#cm-reset-overlay {
pointer-events: auto;
}
sp-dialog[modal] {
z-index: 2147483647 !important;
}
sp-underlay {
z-index: 2147483646 !important;
}
/* ---- Dialog (cm-modal) ---------------------------------------------------- */
dialog.cm-modal {
background: var(--uxp-host-background-color);
color: var(--uxp-host-text-color);
border: 1px solid var(--uxp-host-border-color);
border-radius: 8px;
box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
font-size: var(--uxp-host-font-size);
}
dialog.cm-modal h2 {
margin: 0;
font-size: var(--uxp-host-font-size-larger, 14px);
font-weight: 600;
line-height: 1.3;
color: var(--uxp-host-text-color);
opacity: 1;
}
dialog.cm-modal .desc {
white-space: pre-wrap;
line-height: 1.6;
color: var(--uxp-host-text-color);
}
dialog.cm-modal .muted {
color: var(--uxp-host-text-color-secondary, #9aa0a6);
}
dialog.cm-modal .buttons {
display: flex;
justify-content: flex-end;
gap: 8px;
margin-top: 8px;
}
dialog.cm-modal::backdrop {
background: rgba(0, 0, 0, 0.32);
}
@media (prefers-color-scheme: light), (prefers-color-scheme: lightest) {
dialog.cm-modal::backdrop { background: rgba(0, 0, 0, 0.20); }
}
/* ============================================================================
* フォーカスインジケータ用スタイル(Top Bar & Focus Dot)
* - 要件:
* * パネル上部に常時表示(アコーディオンの開閉やスクロールに影響されない)
* * インジケータは小さな円のみ(テキスト/ラベル無し)
* * 非フォーカス時は控えめ / フォーカス時は明確に点灯
* * Photoshop UI テーマ(ライト/ダーク)に自動追従(--uxp-host-* 変数を使用)
* - 実装ノート:
* * 色は既存トークン --cm-bg / --cm-border / --cm-focus を流用
* * クリック時の挙動(非フォーカス→フォーカス復帰)は ui.js 側で制御
* ========================================================================== */
/* --- 常時表示のトップバー --------------------------------------------------- */
#cmTopBar {
display: flex;
align-items: center;
justify-content: flex-end;
/* 右寄せ配置 */
gap: 8px;
box-sizing: border-box;
height: var(--cm-topbar-h);
padding: 0 8px;
background: var(--cm-bg);
border-bottom: 1px solid var(--cm-border);
}
/* --- 小さな円形インジケータ(テキスト無し) ------------------------------- */
#cmFocusDot {
inline-size: 12px;
width: 12px;
/* 論理プロパティ(LTR/RTLどちらでも一定) */
block-size: 12px;
height: 12px;
border-radius: 50%;
box-sizing: border-box;
transition: background-color 120ms ease, border-color 120ms ease,
box-shadow 120ms ease, transform 100ms ease;
outline: none;
/* マウス操作主体のため、既定アウトラインは無効化 */
/* 既定は「非フォーカス: 控えめ」な見た目 */
background: transparent;
border: 1px solid var(--cm-border);
box-shadow: inset 0 0 0 1px var(--cm-border);
cursor: default;
/* 既定はクリック不可(ui.js で非フォーカス時のみ有効化) */
opacity: 0.95;
/* テーマ差で沈みすぎるのを軽減 */
}
/* --- 状態クラス(ui.js で付け外し) --------------------------------------- */
/* 非フォーカス時: クリックでフォーカス復帰できることを示す(ポインタ形状のみ) */
#cmFocusDot.is-blurred {
cursor: pointer;
/* 塗りは行わず控えめなまま。必要に応じて hover で僅かに強調 */
}
#cmFocusDot.is-blurred:hover {
transform: scale(1.06);
}
/* フォーカス時: はっきり点灯(テーマ準拠ハイライト色) */
#cmFocusDot.is-focused {
background: var(--cm-focus);
border-color: var(--cm-focus);
/* 外周に薄い際立ちを付与(背景色との境界を確保) */
box-shadow: 0 0 0 1px var(--cm-border);
cursor: default;
}
/* --- アクセシビリティ: マウスではなくキーボードでドットがフォーカスされた場合の可視化
※ 通常は tabindex=-1 のため到達しないが、将来の拡張に備えて定義 --- */
#cmFocusDot:focus-visible {
outline: 2px solid var(--cm-focus);
outline-offset: 2px;
}
/* 背景範囲拡張の入力も折り返しやすくする */
.row #bgPad {
flex: 0 1 auto;
flex-basis: auto;
width: 3.5em;
min-width: 2.8em;
}