vanilla-jui 1.5.24 → 1.5.26

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.
@@ -1,5 +1,5 @@
1
1
  @layer components {
2
- #j-editor {
2
+ #j-editor-container {
3
3
  max-width: var(--editor-max-width);
4
4
  border-width: var(--editor-border-width);
5
5
  border-style: var(--editor-border-style);
@@ -13,4 +13,700 @@
13
13
  .ProseMirror {
14
14
  outline: 0;
15
15
  }
16
+
17
+ /* ============================================
18
+ Editor - 文章阅读/编辑器预览样式
19
+ ============================================ */
20
+ .j-editor {
21
+ font-size: var(--editor-font-size);
22
+ line-height: var(--editor-line-height);
23
+ letter-spacing: var(--editor-letter-space);
24
+ word-spacing: var(--editor-word-space);
25
+ word-break: break-word;
26
+ text-rendering: optimizeLegibility;
27
+ -webkit-font-smoothing: antialiased;
28
+ -moz-osx-font-smoothing: grayscale;
29
+ outline: var(--editor-outline);
30
+ position: relative;
31
+ }
32
+
33
+ /* ============================================
34
+ Typography - 段落与标题
35
+ ============================================ */
36
+ .j-editor p:first-child {
37
+ margin-bottom: var(--editor-paragraph-space);
38
+ }
39
+
40
+ .j-editor p:not(:first-child) {
41
+ margin-block: var(--editor-paragraph-space);
42
+ }
43
+
44
+ .j-editor h1,
45
+ .j-editor h2,
46
+ .j-editor h3,
47
+ .j-editor h4,
48
+ .j-editor h5,
49
+ .j-editor h6 {
50
+ margin: var(--editor-heading-space) 0
51
+ calc(var(--editor-heading-space) * 0.75);
52
+ font-weight: 600;
53
+ /* line-height: 1.3; */
54
+ color: var(--editor-heading-fg);
55
+ letter-spacing: -0.02em;
56
+ }
57
+
58
+ .j-editor h1 {
59
+ font-size: 2em;
60
+ font-weight: 700;
61
+ letter-spacing: -0.03em;
62
+ margin-top: 0;
63
+ }
64
+
65
+ .j-editor h2 {
66
+ font-size: 1.625em;
67
+ font-weight: 650;
68
+ padding-bottom: 0.25em;
69
+ border-bottom: 1px solid var(--editor-border-subtle);
70
+ }
71
+
72
+ .j-editor h3 {
73
+ font-size: 1.375em;
74
+ }
75
+
76
+ .j-editor h4 {
77
+ font-size: 1.125em;
78
+ }
79
+
80
+ .j-editor h5,
81
+ .j-editor h6 {
82
+ font-size: 1em;
83
+ }
84
+
85
+ /* 标题后的段落减少间距 */
86
+ .j-editor h1 + p,
87
+ .j-editor h2 + p,
88
+ .j-editor h3 + p,
89
+ .j-editor h4 + p,
90
+ .j-editor h5 + p,
91
+ .j-editor h6 + p {
92
+ margin-top: calc(var(--editor-paragraph-space) * -0.5);
93
+ }
94
+
95
+ /* ============================================
96
+ Inline Elements - 内联元素
97
+ ============================================ */
98
+ .j-editor strong,
99
+ .j-editor b {
100
+ font-weight: 650;
101
+ color: var(--editor-heading-fg);
102
+ }
103
+
104
+ .j-editor em,
105
+ .j-editor i {
106
+ font-style: italic;
107
+ }
108
+
109
+ .j-editor u {
110
+ text-decoration: underline;
111
+ text-decoration-thickness: 4px;
112
+ text-decoration-color: var(--editor-ring);
113
+ text-underline-offset: 0.2em;
114
+ }
115
+
116
+ .j-editor s,
117
+ .j-editor del {
118
+ text-decoration: line-through;
119
+ color: var(--editor-caption-fg);
120
+ }
121
+
122
+ .j-editor mark {
123
+ background: var(--tone-highlight);
124
+ color: var(--tone-highlight-fg);
125
+ padding: 0.1em 0.3em;
126
+ border-radius: 0.2em;
127
+ }
128
+
129
+ .j-editor small {
130
+ font-size: 0.875em;
131
+ color: var(--editor-caption-fg);
132
+ }
133
+
134
+ .j-editor sub {
135
+ vertical-align: sub;
136
+ font-size: 0.75em;
137
+ }
138
+
139
+ .j-editor sup {
140
+ vertical-align: super;
141
+ font-size: 0.75em;
142
+ }
143
+
144
+ .j-editor abbr[title] {
145
+ text-decoration: underline dotted;
146
+ text-decoration-color: var(--tone-muted);
147
+ text-underline-offset: 0.2em;
148
+ cursor: help;
149
+ }
150
+
151
+ .j-editor time {
152
+ white-space: nowrap;
153
+ color: var(--editor-caption-fg);
154
+ }
155
+
156
+ .j-editor ruby {
157
+ font-size: 0.95em;
158
+ }
159
+
160
+ .j-editor rt {
161
+ font-size: 0.7em;
162
+ color: var(--editor-caption-fg);
163
+ }
164
+
165
+ /* ============================================
166
+ Links - 链接
167
+ ============================================ */
168
+ .j-editor a {
169
+ color: var(--editor-link);
170
+ text-decoration: none;
171
+ text-decoration-color: transparent;
172
+ text-underline-offset: 0.15em;
173
+ transition:
174
+ color 0.15s,
175
+ text-decoration-color 0.15s;
176
+ }
177
+
178
+ .j-editor a:hover {
179
+ color: var(--editor-link-hover);
180
+ text-decoration: underline;
181
+ text-decoration-color: var(--editor-link-hover);
182
+ }
183
+
184
+ .j-editor a:visited {
185
+ color: var(--editor-link-visited);
186
+ }
187
+
188
+ .j-editor a:active {
189
+ color: var(--editor-link-active);
190
+ }
191
+
192
+ /* ============================================
193
+ Lists - 列表
194
+ ============================================ */
195
+ .j-editor ul,
196
+ .j-editor ol {
197
+ margin: 0 0 var(--editor-paragraph-space);
198
+ padding-left: 1.75em;
199
+ }
200
+
201
+ .j-editor ul li,
202
+ .j-editor ol li {
203
+ margin-bottom: var(--editor-list-space);
204
+ padding-left: 0.25em;
205
+ }
206
+
207
+ .j-editor ul li:last-child,
208
+ .j-editor ol li:last-child {
209
+ margin-bottom: 0;
210
+ }
211
+
212
+ .j-editor ul {
213
+ list-style-type: disc;
214
+ }
215
+
216
+ .j-editor ol {
217
+ list-style-type: decimal;
218
+ }
219
+
220
+ .j-editor ul ul,
221
+ .j-editor ol ol,
222
+ .j-editor ol ul,
223
+ .j-editor ul ol {
224
+ margin-top: var(--editor-list-space);
225
+ margin-bottom: 0;
226
+ }
227
+
228
+ .j-editor ul ul {
229
+ list-style-type: circle;
230
+ }
231
+
232
+ .j-editor ul ul ul {
233
+ list-style-type: square;
234
+ }
235
+
236
+ .j-editor ol ol {
237
+ list-style-type: lower-alpha;
238
+ }
239
+
240
+ .j-editor ol ol ol {
241
+ list-style-type: lower-roman;
242
+ }
243
+
244
+ .j-editor ul p,
245
+ .j-editor ol p {
246
+ margin: 0;
247
+ }
248
+
249
+ /* Definition List */
250
+ .j-editor dl {
251
+ margin: 0 0 var(--editor-block-space);
252
+ }
253
+
254
+ .j-editor dt {
255
+ font-weight: 600;
256
+ margin-top: 0.75em;
257
+ margin-bottom: 0.125em;
258
+ color: var(--editor-heading-fg);
259
+ }
260
+
261
+ .j-editor dt:first-child {
262
+ margin-top: 0;
263
+ }
264
+
265
+ .j-editor dd {
266
+ margin: 0 0 0.75em;
267
+ padding-left: 1em;
268
+ color: var(--tone-body);
269
+ }
270
+
271
+ .j-editor dd + dt {
272
+ margin-top: 1em;
273
+ }
274
+
275
+ /* checkbox - 任务列表 */
276
+ .j-editor .j-checkbox {
277
+ margin-block: var(--editor-paragraph-space);
278
+ }
279
+
280
+ /* ============================================
281
+ Blockquote - 引用
282
+ ============================================ */
283
+ .j-editor blockquote {
284
+ margin: var(--editor-block-space) 0;
285
+ margin-left: 0;
286
+ margin-right: 0;
287
+ padding: 1em 1.5em;
288
+ border-left: 3px solid var(--editor-border-tone);
289
+ border-radius: 0 var(--radius-md) var(--radius-md) 0;
290
+ background-color: var(--editor-blockquote-bg);
291
+ color: var(--editor-blockquote-fg);
292
+ font-style: italic;
293
+ }
294
+
295
+ .j-editor blockquote p {
296
+ margin: 0;
297
+ }
298
+
299
+ .j-editor blockquote p + p {
300
+ margin-top: 0.75em;
301
+ }
302
+
303
+ .j-editor cite {
304
+ display: block;
305
+ margin-top: 0.75em;
306
+ font-style: normal;
307
+ font-size: 0.875em;
308
+ color: var(--editor-caption-fg);
309
+ }
310
+
311
+ .j-editor cite::before {
312
+ content: '— ';
313
+ }
314
+
315
+ /* ============================================
316
+ Code - 代码
317
+ ============================================ */
318
+ code {
319
+ box-decoration-break: clone;
320
+ }
321
+
322
+ .j-editor code:not([class*='language-']) {
323
+ font-family:
324
+ 'SF Mono', SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
325
+ font-size: 0.875em;
326
+ border: 1px solid var(--editor-border-subtle);
327
+ border-radius: var(--radius-sm);
328
+ word-break: break-word;
329
+ padding: 0.15em 0.4em;
330
+ background: var(--editor-code-bg);
331
+ color: var(--editor-code-fg);
332
+ }
333
+
334
+ .j-editor kbd {
335
+ font-family: inherit;
336
+ font-size: 0.875em;
337
+ background: var(--editor-code-bg);
338
+ border: 1px solid var(--editor-border);
339
+ border-bottom-width: 2px;
340
+ border-radius: var(--radius-sm);
341
+ padding: 0.1em 0.4em;
342
+ color: var(--tone-body);
343
+ }
344
+
345
+ .j-editor pre {
346
+ margin: var(--editor-block-space) 0;
347
+ background: var(--editor-code-bg);
348
+ font-size: 0.875em;
349
+ line-height: 1.6;
350
+ tab-size: 2;
351
+ }
352
+
353
+ .j-editor pre code {
354
+ background: none;
355
+ color: inherit;
356
+ font-size: inherit;
357
+ }
358
+
359
+ .j-editor pre.code-block {
360
+ position: relative;
361
+ margin-block: 1rem;
362
+ border-radius: var(--radius-md);
363
+ border: 1px solid var(--editor-border-subtle);
364
+ overflow: auto;
365
+ scrollbar-width: thin;
366
+ scrollbar-color: var(--ui-border) transparent;
367
+ color: var(--ui-fg);
368
+ background: var(--editor-bg-subtle);
369
+ }
370
+
371
+ .j-radius-round .j-editor pre.code-block {
372
+ border-radius: 1.25rem;
373
+ }
374
+
375
+ .code-block .code-header {
376
+ display: flex;
377
+ align-items: center;
378
+ gap: 40px;
379
+ padding: 0.5rem 1rem 0;
380
+ font-size: 12px;
381
+ color: var(--ui-fg-soft);
382
+ }
383
+
384
+ .code-block .code-header .code-dots {
385
+ width: 8px;
386
+ height: 8px;
387
+ border-radius: 50%;
388
+ background: var(--state-success);
389
+ box-shadow:
390
+ 14px 0 0 var(--state-warning),
391
+ 28px 0 0 var(--state-danger);
392
+ }
393
+
394
+ .code-block .code-header .code-language,
395
+ .code-block .code-header select {
396
+ font-size: 0.75rem;
397
+ color: var(--ui-fg-soft);
398
+ }
399
+
400
+ .code-block .code-header select {
401
+ appearance: none;
402
+ background: transparent;
403
+ border: none;
404
+ }
405
+
406
+ .code-block .code-header select::-ms-expand {
407
+ display: none;
408
+ }
409
+
410
+ .j-editor pre code[class*='language-'] {
411
+ display: block;
412
+ padding: 1.25em 1.5em;
413
+ }
414
+
415
+ .j-editor pre.code-block .code-header + code[class*='language-'] {
416
+ padding: 0.5rem 1rem 1rem;
417
+ }
418
+
419
+ /* purposely ignored */
420
+ .hljs-char.escape_,
421
+ .hljs-link,
422
+ .hljs-params,
423
+ .hljs-property,
424
+ .hljs-punctuation,
425
+ .hljs-tag {
426
+ color: var(--ui-gray);
427
+ }
428
+
429
+ /* prettylights-syntax-entity */
430
+ .hljs-title,
431
+ .hljs-title.class_,
432
+ .hljs-title.class_.inherited__,
433
+ .hljs-title.function_ {
434
+ color: var(--ui-violet);
435
+ }
436
+
437
+ /* prettylights-syntax-constant */
438
+ .hljs-attr,
439
+ .hljs-attribute,
440
+ .hljs-literal,
441
+ .hljs-meta,
442
+ .hljs-number,
443
+ .hljs-operator,
444
+ .hljs-variable,
445
+ .hljs-selector-attr,
446
+ .hljs-selector-class,
447
+ .hljs-selector-id {
448
+ color: var(--ui-teal);
449
+ }
450
+
451
+ /* prettylights-syntax-keyword */
452
+ .hljs-doctag,
453
+ .hljs-keyword,
454
+ .hljs-meta .hljs-keyword,
455
+ .hljs-template-tag,
456
+ .hljs-template-variable,
457
+ .hljs-type,
458
+ .hljs-variable.language_ {
459
+ color: var(--ui-tomato);
460
+ }
461
+
462
+ /* prettylights-syntax-string */
463
+ .hljs-regexp,
464
+ .hljs-string,
465
+ .hljs-meta .hljs-string {
466
+ color: var(--ui-pink);
467
+ }
468
+
469
+ /* prettylights-syntax-variable */
470
+ .hljs-built_in,
471
+ .hljs-symbol {
472
+ color: var(--ui-orange);
473
+ }
474
+
475
+ /* prettylights-syntax-comment */
476
+ .hljs-comment,
477
+ .hljs-code,
478
+ .hljs-formula {
479
+ color: var(--ui-fg-soft);
480
+ }
481
+
482
+ .language-markdown .hljs-code {
483
+ color: inherit;
484
+ }
485
+
486
+ /* .dark .hljs-comment,
487
+ .dark .hljs-code,
488
+ .dark .hljs-formula {
489
+ color: var(--ui-gray-shade);
490
+ } */
491
+
492
+ /* prettylights-syntax-entity-tag */
493
+ .hljs-name,
494
+ .hljs-quote,
495
+ .hljs-selector-tag,
496
+ .hljs-selector-pseudo {
497
+ color: var(--ui-indigo);
498
+ }
499
+
500
+ /* prettylights-syntax-storage-modifier-import */
501
+ .hljs-subst {
502
+ color: var(--ui-fg);
503
+ }
504
+
505
+ /* prettylights-syntax-markup-heading */
506
+ .hljs-section {
507
+ color: var(--ui-teal);
508
+ font-weight: bold;
509
+ }
510
+
511
+ /* prettylights-syntax-markup-list */
512
+ .hljs-bullet {
513
+ color: var(--ui-gold);
514
+ }
515
+
516
+ /* prettylights-syntax-markup-italic */
517
+ .hljs-emphasis {
518
+ color: var(--ui-fg);
519
+ font-style: italic;
520
+ }
521
+
522
+ /* prettylights-syntax-markup-bold */
523
+ .hljs-strong {
524
+ color: var(--ui-fg);
525
+ font-weight: bold;
526
+ }
527
+
528
+ /* prettylights-syntax-markup-inserted */
529
+ .hljs-addition {
530
+ color: var(--ui-indigo);
531
+ background-color: #f0fff4;
532
+ }
533
+
534
+ /* prettylights-syntax-markup-deleted */
535
+ .hljs-deletion {
536
+ color: var(--ui-ruby);
537
+ background-color: #ffeef0;
538
+ }
539
+
540
+ /* ============================================
541
+ Media - 媒体
542
+ ============================================ */
543
+
544
+ .j-editor img {
545
+ max-width: 100%;
546
+ height: auto;
547
+ border-radius: var(--radius-lg);
548
+ }
549
+
550
+ .j-editor figure {
551
+ margin: var(--editor-block-space) 0;
552
+ }
553
+
554
+ .j-editor figure img,
555
+ .j-editor figure video,
556
+ .j-editor figure iframe {
557
+ display: block;
558
+ margin: 0 auto;
559
+ }
560
+
561
+ .j-editor figcaption {
562
+ margin-top: 0.75em;
563
+ font-size: 0.875em;
564
+ color: var(--editor-caption-fg);
565
+ text-align: center;
566
+ line-height: 1.5;
567
+ }
568
+
569
+ .j-editor iframe,
570
+ .j-editor video,
571
+ .j-editor audio {
572
+ max-width: 100%;
573
+ }
574
+
575
+ .j-editor video,
576
+ .j-editor audio {
577
+ display: block;
578
+ border-radius: var(--radius-lg);
579
+ }
580
+
581
+ .j-editor video {
582
+ background-color: var(--ui-fg);
583
+ }
584
+
585
+ .j-editor figure:has(audio) {
586
+ display: flex;
587
+ flex-direction: column;
588
+ justify-content: center;
589
+ align-items: center;
590
+ }
591
+
592
+ /* ============================================
593
+ Table - 表格
594
+ ============================================ */
595
+
596
+ .j-editor table {
597
+ display: block;
598
+ margin-block: var(--editor-block-space);
599
+ }
600
+
601
+ /* ============================================
602
+ Horizontal Rule - 分割线
603
+ ============================================ */
604
+
605
+ .j-editor hr {
606
+ margin: var(--editor-block-space) 0;
607
+ border: 0;
608
+ height: 1px;
609
+ background: var(--editor-border);
610
+ }
611
+
612
+ /* ============================================
613
+ Details / Summary - 折叠
614
+ ============================================ */
615
+
616
+ .j-editor details {
617
+ margin: var(--editor-block-space) 0;
618
+ padding: 1em;
619
+ background-color: var(--editor-bg-subtle);
620
+ border-radius: var(--radius-lg);
621
+ border: 1px solid var(--editor-border-subtle);
622
+ }
623
+
624
+ .j-editor summary {
625
+ cursor: pointer;
626
+ font-weight: 600;
627
+ color: var(--editor-heading-fg);
628
+ outline: none;
629
+ list-style: none;
630
+ display: flex;
631
+ align-items: center;
632
+ gap: 0.5em;
633
+ }
634
+
635
+ .j-editor summary::before {
636
+ content: '▸';
637
+ display: inline-block;
638
+ transition: transform 0.2s ease;
639
+ }
640
+
641
+ .j-editor details[open] > summary::before {
642
+ transform: rotate(90deg);
643
+ }
644
+
645
+ .j-editor details[open] p,
646
+ .j-editor details[open] ul,
647
+ .j-editor details[open] ol,
648
+ .j-editor details[open] > * {
649
+ margin-bottom: 1em;
650
+ }
651
+
652
+ /* .j-editor details[open]>summary {
653
+ margin-bottom: 0.75em;
654
+ } */
655
+
656
+ .j-editor details[open] > summary + * {
657
+ margin-top: 0;
658
+ }
659
+
660
+ .j-editor details[open] > *:last-child {
661
+ margin-bottom: 0;
662
+ }
663
+
664
+ /* ============================================
665
+ Progress / Meter
666
+ ============================================ */
667
+
668
+ .j-editor progress {
669
+ max-width: 100%;
670
+ height: 0.5em;
671
+ margin: 0.5em 0;
672
+ border-radius: var(--radius-full);
673
+ overflow: hidden;
674
+ }
675
+
676
+ .j-editor meter {
677
+ max-width: 100%;
678
+ height: 1em;
679
+ margin: 0.25em 0;
680
+ }
681
+
682
+ /* ============================================
683
+ Address
684
+ ============================================ */
685
+
686
+ .j-editor address {
687
+ font-style: normal;
688
+ margin: 0 0 var(--editor-block-space);
689
+ padding: 1em 1.25em;
690
+ background-color: var(--editor-bg-subtle);
691
+ border-radius: var(--radius-lg);
692
+ color: var(--editor-caption-fg);
693
+ font-size: 0.9375em;
694
+ }
695
+
696
+ /* ============================================
697
+ Block Item - 通用块级元素
698
+ ============================================ */
699
+
700
+ .j-editor .block-item {
701
+ margin: var(--editor-block-space) 0;
702
+ }
703
+
704
+ /* First/Last child margin reset */
705
+ .j-editor > *:first-child {
706
+ margin-top: 0;
707
+ }
708
+
709
+ .j-editor > *:last-child {
710
+ margin-bottom: 0;
711
+ }
16
712
  }
package/src/css/form.css CHANGED
@@ -384,20 +384,17 @@
384
384
  /* type checkbox */
385
385
  .j-checkbox {
386
386
  display: flex;
387
- /* gap: var(--checkbox-gap); */
388
387
  flex-wrap: wrap;
389
388
  margin: 0;
390
389
  }
391
390
 
392
391
  .j-checkbox.is-vertical {
393
392
  flex-direction: column;
394
- /* --checkbox-gap: var(--s3); */
395
393
  }
396
394
 
397
395
  .j-checkbox,
398
396
  .j-checkbox.is-horizontal {
399
397
  flex-direction: row;
400
- /* --checkbox-gap: var(--s4); */
401
398
  }
402
399
 
403
400
  .j-checkbox label {
@@ -938,14 +935,12 @@
938
935
  .j-radio.is-group label input[type='radio']:disabled + .radio-text {
939
936
  cursor: not-allowed;
940
937
  background-color: var(--ui-disabled-bg);
941
- /* opacity: var(--opacity-disabled); */
942
938
  color: var(--ui-disabled-fg);
943
939
  }
944
940
 
945
941
  /* checkbox disabled */
946
942
  .j-checkbox label:has(input[type='checkbox']:disabled) {
947
943
  cursor: not-allowed;
948
- /* opacity: var(--opacity-disabled); */
949
944
  color: var(--ui-disabled-fg);
950
945
  }
951
946