orz-markdown 1.0.0 → 1.2.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,658 @@
1
+ /* ==========================================================================
2
+ Minimal Functional Stylesheet — orz-markdown
3
+ Based on common.css structural rules + stripped-down theme styles.
4
+
5
+ This file provides all necessary layout and visual distinction to render
6
+ every parser feature correctly. It contains NO decorative styles:
7
+ no gradients, no shadows, no custom fonts, no fancy borders or ornaments.
8
+
9
+ Use one of the bundled theme stylesheets for a polished visual experience.
10
+ ========================================================================== */
11
+
12
+ /* --------------------------------------------------------------------------
13
+ Shared structural rules (from common.css) — required for correct behavior
14
+ -------------------------------------------------------------------------- */
15
+
16
+ .markdown-body table {
17
+ width: max-content;
18
+ max-width: 100%;
19
+ display: block;
20
+ overflow-x: auto;
21
+ }
22
+
23
+ .markdown-body img {
24
+ display: block;
25
+ width: auto;
26
+ max-width: 100%;
27
+ max-height: 100%;
28
+ height: auto;
29
+ object-fit: contain;
30
+ }
31
+
32
+ .markdown-body p > img {
33
+ display: inline;
34
+ margin: 0;
35
+ }
36
+
37
+ .markdown-body span.success,
38
+ .markdown-body span.info,
39
+ .markdown-body span.warning,
40
+ .markdown-body span.danger {
41
+ display: inline-flex;
42
+ align-items: center;
43
+ line-height: 1;
44
+ white-space: nowrap;
45
+ }
46
+
47
+ .markdown-body div.smiles-render {
48
+ display: flex;
49
+ align-items: center;
50
+ justify-content: center;
51
+ margin: 1.5rem 0;
52
+ min-height: 0;
53
+ padding: 0;
54
+ background: transparent;
55
+ border: none;
56
+ border-radius: 0;
57
+ box-shadow: none;
58
+ }
59
+
60
+ .markdown-body div.smiles-render canvas,
61
+ .markdown-body canvas[data-smiles] {
62
+ display: block;
63
+ max-width: min(100%, 16rem);
64
+ height: auto;
65
+ background: transparent;
66
+ border-radius: 0;
67
+ box-shadow: none;
68
+ }
69
+
70
+ /* QR code inline widget */
71
+ .markdown-body span.qrcode {
72
+ display: inline-block;
73
+ position: relative;
74
+ padding: 4px;
75
+ line-height: 0;
76
+ cursor: zoom-in;
77
+ background: #fff; /* keep white so QR SVG is readable on any background */
78
+ }
79
+
80
+ .markdown-body .qrcode__icon {
81
+ position: absolute;
82
+ top: 0.25rem;
83
+ right: 0.25rem;
84
+ width: 1rem;
85
+ height: 1rem;
86
+ display: grid;
87
+ place-items: center;
88
+ border-radius: 999px;
89
+ background: rgba(255, 255, 255, 0.92);
90
+ color: #111;
91
+ font-size: 0.7rem;
92
+ line-height: 1;
93
+ opacity: 0;
94
+ transition: opacity 0.16s ease;
95
+ pointer-events: none;
96
+ }
97
+
98
+ .markdown-body span.qrcode:hover .qrcode__icon,
99
+ .markdown-body span.qrcode:focus-visible .qrcode__icon,
100
+ .markdown-body span.qrcode.is-expanded .qrcode__icon {
101
+ opacity: 1;
102
+ }
103
+
104
+ .markdown-body span.qrcode.is-expanded {
105
+ visibility: hidden;
106
+ }
107
+
108
+ /* QR code expanded overlay */
109
+ .qrcode-overlay {
110
+ position: fixed !important;
111
+ top: 50%;
112
+ left: 50%;
113
+ right: auto;
114
+ bottom: auto;
115
+ transform: translate(-50%, -50%);
116
+ z-index: 10001;
117
+ display: flex !important;
118
+ align-items: center;
119
+ justify-content: center;
120
+ width: min(90vmin, 36rem) !important;
121
+ height: min(90vmin, 36rem) !important;
122
+ aspect-ratio: 1 / 1;
123
+ max-width: calc(100vw - 2rem) !important;
124
+ max-height: calc(100vh - 2rem) !important;
125
+ padding: 1.5rem !important;
126
+ background: rgba(10, 16, 24, 0.86) !important;
127
+ border-radius: 1rem !important;
128
+ cursor: zoom-out;
129
+ }
130
+
131
+ .markdown-body span.qrcode svg,
132
+ .qrcode-overlay svg {
133
+ display: block;
134
+ width: 100%;
135
+ height: auto;
136
+ }
137
+
138
+ .qrcode-overlay svg {
139
+ width: 100% !important;
140
+ height: 100% !important;
141
+ max-width: 100%;
142
+ max-height: 100%;
143
+ flex: 0 1 auto;
144
+ object-fit: contain;
145
+ }
146
+
147
+ .qrcode-overlay .qrcode__icon {
148
+ opacity: 1;
149
+ }
150
+
151
+ /* Print rules */
152
+ @media print {
153
+ table {
154
+ display: table !important;
155
+ width: auto !important;
156
+ max-width: 100% !important;
157
+ }
158
+
159
+ thead { display: table-header-group; }
160
+ tfoot { display: table-footer-group; }
161
+
162
+ tr, img, svg, canvas, iframe, video, pre, blockquote,
163
+ .smiles-render, .qrcode {
164
+ break-inside: avoid;
165
+ page-break-inside: avoid;
166
+ }
167
+
168
+ .youtube-embed { display: none !important; }
169
+ .qrcode__icon { display: none !important; }
170
+ }
171
+
172
+ /* --------------------------------------------------------------------------
173
+ Base reset & page layout
174
+ -------------------------------------------------------------------------- */
175
+
176
+ *, *::before, *::after { box-sizing: border-box; }
177
+
178
+ html {
179
+ font-size: 1rem;
180
+ -webkit-text-size-adjust: 100%;
181
+ }
182
+
183
+ body {
184
+ margin: 0;
185
+ padding: 1.5rem 1rem;
186
+ font-family: system-ui, -apple-system, sans-serif;
187
+ font-size: 1rem;
188
+ line-height: 1.7;
189
+ color: #222;
190
+ background: #f4f4f4;
191
+ }
192
+
193
+ /* --------------------------------------------------------------------------
194
+ Article wrapper
195
+ -------------------------------------------------------------------------- */
196
+
197
+ .markdown-body {
198
+ display: flow-root;
199
+ max-width: 860px;
200
+ margin: 0 auto;
201
+ padding: 2rem;
202
+ background: #fff;
203
+ border: 1px solid #ddd;
204
+ }
205
+
206
+ .markdown-body > :first-child { margin-top: 0; }
207
+
208
+ /* --------------------------------------------------------------------------
209
+ Headings
210
+ -------------------------------------------------------------------------- */
211
+
212
+ h1, h2, h3, h4, h5, h6 {
213
+ clear: both;
214
+ margin: 2em 0 0.6em;
215
+ font-weight: 700;
216
+ line-height: 1.3;
217
+ scroll-margin-top: 4rem;
218
+ }
219
+
220
+ h1:first-child, h2:first-child { margin-top: 0; }
221
+
222
+ h1 { font-size: 2rem; text-align: center; border-bottom: 2px solid #ccc; padding-bottom: 0.4em; }
223
+ h2 { font-size: 1.6rem; border-bottom: 1px solid #ccc; padding-bottom: 0.2em; }
224
+ h3 { font-size: 1.3rem; }
225
+ h4 { font-size: 1.1rem; }
226
+ h5 { font-size: 1rem; }
227
+ h6 { font-size: 0.9rem; color: #555; }
228
+
229
+ /* Heading permalink anchor — hidden until hover */
230
+ .header-anchor {
231
+ float: left;
232
+ margin-left: -1.2em;
233
+ padding-right: 0.3em;
234
+ text-decoration: none;
235
+ opacity: 0;
236
+ transition: opacity 0.15s;
237
+ }
238
+
239
+ h1:hover .header-anchor,
240
+ h2:hover .header-anchor,
241
+ h3:hover .header-anchor,
242
+ h4:hover .header-anchor,
243
+ h5:hover .header-anchor,
244
+ h6:hover .header-anchor { opacity: 0.5; }
245
+
246
+ /* --------------------------------------------------------------------------
247
+ Block spacing
248
+ -------------------------------------------------------------------------- */
249
+
250
+ p, ul, ol, blockquote, pre, table,
251
+ .toc-wrapper, details.spoil, .tabs, .cols, .youtube-embed, .mermaid, .smiles-render {
252
+ margin: 0 0 1.5rem;
253
+ }
254
+
255
+ p:last-child,
256
+ ul:last-child,
257
+ ol:last-child,
258
+ blockquote:last-child,
259
+ pre:last-child,
260
+ table:last-child { margin-bottom: 0; }
261
+
262
+ /* --------------------------------------------------------------------------
263
+ Inline text elements
264
+ -------------------------------------------------------------------------- */
265
+
266
+ a { color: #0060cc; text-underline-offset: 0.15em; }
267
+ a:visited { color: #5050aa; }
268
+ strong { font-weight: 700; }
269
+ s, del { color: #888; text-decoration: line-through; }
270
+ mark { background: #ffe284; padding: 0.05em 0.2em; }
271
+ ins { text-decoration: underline; color: #167857; }
272
+ sub, sup { font-size: 0.72em; }
273
+
274
+ /* --------------------------------------------------------------------------
275
+ Code
276
+ -------------------------------------------------------------------------- */
277
+
278
+ code {
279
+ font-family: monospace;
280
+ font-size: 0.9em;
281
+ background: #f5f5f5;
282
+ border: 1px solid #ddd;
283
+ border-radius: 3px;
284
+ padding: 0.1em 0.35em;
285
+ }
286
+
287
+ pre {
288
+ overflow-x: auto;
289
+ padding: 1rem;
290
+ background: #f5f5f5;
291
+ border: 1px solid #ddd;
292
+ }
293
+
294
+ pre code {
295
+ display: block;
296
+ padding: 0;
297
+ border: 0;
298
+ background: transparent;
299
+ font-size: 0.875rem;
300
+ line-height: 1.65;
301
+ }
302
+
303
+ /* --------------------------------------------------------------------------
304
+ Blockquote
305
+ -------------------------------------------------------------------------- */
306
+
307
+ blockquote {
308
+ padding: 0.75rem 1rem;
309
+ border-left: 4px solid #ccc;
310
+ color: #555;
311
+ background: #f9f9f9;
312
+ }
313
+
314
+ blockquote blockquote { background: #efefef; margin-top: 0.75rem; }
315
+ blockquote > *:last-child { margin-bottom: 0; }
316
+
317
+ /* --------------------------------------------------------------------------
318
+ Lists
319
+ -------------------------------------------------------------------------- */
320
+
321
+ ul, ol { padding-left: 1.5rem; }
322
+ li { margin-bottom: 0.3rem; }
323
+ li > ul, li > ol { margin-top: 0.3rem; margin-bottom: 0; }
324
+
325
+ /* Task lists */
326
+ .task-list-item { list-style: none; padding-left: 0; }
327
+ .task-list-item-checkbox,
328
+ .task-list-item input[type='checkbox'] {
329
+ margin-right: 0.5rem;
330
+ vertical-align: -0.1em;
331
+ }
332
+
333
+ /* --------------------------------------------------------------------------
334
+ Table
335
+ -------------------------------------------------------------------------- */
336
+
337
+ table { border-collapse: collapse; }
338
+
339
+ th, td {
340
+ padding: 0.55rem 0.9rem;
341
+ border: 1px solid #ccc;
342
+ text-align: left;
343
+ vertical-align: top;
344
+ }
345
+
346
+ thead th {
347
+ background: #f0f0f0;
348
+ font-weight: 700;
349
+ white-space: nowrap;
350
+ }
351
+
352
+ tbody tr:nth-child(even) td { background: #fafafa; }
353
+
354
+ /* --------------------------------------------------------------------------
355
+ Horizontal rule
356
+ -------------------------------------------------------------------------- */
357
+
358
+ hr {
359
+ height: 1px;
360
+ margin: 2rem 0;
361
+ border: 0;
362
+ background: #ddd;
363
+ }
364
+
365
+ /* --------------------------------------------------------------------------
366
+ Image
367
+ -------------------------------------------------------------------------- */
368
+
369
+ img { margin: 0 auto; }
370
+
371
+ /* --------------------------------------------------------------------------
372
+ Footnotes
373
+ -------------------------------------------------------------------------- */
374
+
375
+ .footnote-ref { font-size: 0.85em; }
376
+ .footnote-ref a, .footnote-backref { color: #0060cc; text-decoration: none; }
377
+ .footnotes-sep { margin: 2rem 0 1rem; }
378
+ .footnotes {
379
+ font-size: 0.875rem;
380
+ color: #555;
381
+ border-top: 1px solid #ddd;
382
+ padding-top: 1rem;
383
+ }
384
+ .footnotes ol { margin-bottom: 0; }
385
+
386
+ /* --------------------------------------------------------------------------
387
+ KaTeX math
388
+ -------------------------------------------------------------------------- */
389
+
390
+ .katex { font-size: 1.06em; }
391
+
392
+ .katex-display {
393
+ overflow-x: auto;
394
+ overflow-y: hidden;
395
+ padding: 0.75rem 1rem;
396
+ background: #f9f9f9;
397
+ border: 1px solid #ddd;
398
+ }
399
+
400
+ .katex-error {
401
+ color: #c0392b;
402
+ font-family: monospace;
403
+ font-size: 0.875rem;
404
+ }
405
+
406
+ /* --------------------------------------------------------------------------
407
+ Semantic containers — success / info / warning / danger
408
+ -------------------------------------------------------------------------- */
409
+
410
+ div.success, div.info, div.warning, div.danger {
411
+ margin-bottom: 1.5rem;
412
+ padding: 0.875rem 1rem;
413
+ border: 1px solid;
414
+ }
415
+
416
+ div.success > *:last-child,
417
+ div.info > *:last-child,
418
+ div.warning > *:last-child,
419
+ div.danger > *:last-child { margin-bottom: 0; }
420
+
421
+ div.success { background: #efffed; border-color: #5ab85a; color: #1a5e2a; }
422
+ div.info { background: #e8f4fd; border-color: #5a9fd4; color: #1a4a70; }
423
+ div.warning { background: #fff8e1; border-color: #e0a820; color: #7a5c00; }
424
+ div.danger { background: #fff0f0; border-color: #d45a5a; color: #7a1a1a; }
425
+
426
+ /* First strong/bold in a callout adopts the callout's text color */
427
+ div.success > p:first-child > strong:first-child { color: #1a5e2a; }
428
+ div.info > p:first-child > strong:first-child { color: #1a4a70; }
429
+ div.warning > p:first-child > strong:first-child { color: #7a5c00; }
430
+ div.danger > p:first-child > strong:first-child { color: #7a1a1a; }
431
+
432
+ /* --------------------------------------------------------------------------
433
+ Layout containers — left / right / center
434
+ -------------------------------------------------------------------------- */
435
+
436
+ .left {
437
+ float: left;
438
+ max-width: min(44%, 22rem);
439
+ padding: 0.75rem;
440
+ border: 1px solid #ddd;
441
+ margin: 0 1.5rem 1rem 0;
442
+ background: #fafafa;
443
+ }
444
+
445
+ .right { text-align: right; margin-bottom: 1rem; }
446
+
447
+ .center {
448
+ text-align: center;
449
+ margin: 0 auto 1.5rem;
450
+ max-width: min(100%, 42rem);
451
+ }
452
+
453
+ /* --------------------------------------------------------------------------
454
+ Spoiler (details/summary)
455
+ -------------------------------------------------------------------------- */
456
+
457
+ details.spoil {
458
+ border: 1px solid #ccc;
459
+ overflow: hidden;
460
+ margin-bottom: 1.5rem;
461
+ }
462
+
463
+ details.spoil > summary {
464
+ display: flex;
465
+ align-items: center;
466
+ gap: 0.5rem;
467
+ padding: 0.75rem 1rem;
468
+ cursor: pointer;
469
+ list-style: none;
470
+ user-select: none;
471
+ font-weight: 600;
472
+ background: #f5f5f5;
473
+ }
474
+
475
+ details.spoil > summary::-webkit-details-marker { display: none; }
476
+
477
+ details.spoil > summary::before { content: '+'; font-weight: 700; }
478
+ details.spoil[open] > summary::before { content: '–'; }
479
+ details.spoil[open] > summary { border-bottom: 1px solid #ddd; }
480
+ details.spoil > :not(summary) { padding: 0.75rem 1rem 1rem; }
481
+
482
+ /* --------------------------------------------------------------------------
483
+ Tabs
484
+ -------------------------------------------------------------------------- */
485
+
486
+ .tabs {
487
+ border: 1px solid #ccc;
488
+ overflow: hidden;
489
+ margin-bottom: 1.5rem;
490
+ }
491
+
492
+ .tabs-bar {
493
+ display: flex;
494
+ gap: 0.2rem;
495
+ padding: 0.35rem;
496
+ overflow-x: auto;
497
+ border-bottom: 1px solid #ccc;
498
+ background: #f5f5f5;
499
+ scrollbar-width: none;
500
+ }
501
+
502
+ .tabs-bar::-webkit-scrollbar { display: none; }
503
+
504
+ .tabs-bar-btn {
505
+ border: 1px solid transparent;
506
+ padding: 0.4rem 0.75rem;
507
+ background: transparent;
508
+ cursor: pointer;
509
+ white-space: nowrap;
510
+ font-size: 0.875rem;
511
+ font-weight: 600;
512
+ }
513
+
514
+ .tabs-bar-btn:hover { background: #e5e5e5; }
515
+ .tabs-bar-btn.active { background: #fff; border-color: #ccc; }
516
+
517
+ /* Panel visibility — controlled by JS */
518
+ .tab { display: none; padding: 1rem; }
519
+ .tab.active { display: block; }
520
+
521
+ /* Fallback when JS has not run: show all panels */
522
+ .tabs:not([data-js]) .tab { display: block; }
523
+ .tabs:not([data-js]) .tab + .tab { border-top: 1px solid #ddd; }
524
+
525
+ /* --------------------------------------------------------------------------
526
+ Columns grid
527
+ -------------------------------------------------------------------------- */
528
+
529
+ .cols {
530
+ display: grid;
531
+ grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
532
+ gap: 1rem;
533
+ align-items: start;
534
+ }
535
+
536
+ .col {
537
+ min-width: 0;
538
+ padding: 0.875rem 1rem;
539
+ border: 1px solid #ddd;
540
+ background: #fafafa;
541
+ }
542
+
543
+ .col > *:last-child { margin-bottom: 0; }
544
+
545
+ /* --------------------------------------------------------------------------
546
+ Table of contents
547
+ -------------------------------------------------------------------------- */
548
+
549
+ .toc-wrapper { position: relative; }
550
+
551
+ nav.toc,
552
+ .toc-list {
553
+ padding: 0.875rem 1.1rem;
554
+ border: 1px solid #ddd;
555
+ background: #fafafa;
556
+ }
557
+
558
+ nav.toc ul, .toc-list ul { margin: 0; padding-left: 1.1rem; }
559
+ nav.toc li, .toc-list li { margin-bottom: 0.2rem; list-style: none; }
560
+ nav.toc li::before, .toc-list li::before { display: none; }
561
+ nav.toc a, .toc-list a { text-decoration: none; color: #0060cc; }
562
+ nav.toc a:hover, .toc-list a:hover { text-decoration: underline; }
563
+
564
+ /* --------------------------------------------------------------------------
565
+ Span colour classes
566
+ -------------------------------------------------------------------------- */
567
+
568
+ span.red { color: #c0392b; }
569
+ span.yellow { color: #9a7615; }
570
+ span.green { color: #218763; }
571
+ span.blue { color: #1d6db0; }
572
+
573
+ /* Inline badge variants */
574
+ span.success,
575
+ span.info,
576
+ span.warning,
577
+ span.danger {
578
+ padding: 0.1em 0.5em;
579
+ border: 1px solid;
580
+ border-radius: 999px;
581
+ font-size: 0.82em;
582
+ font-weight: 700;
583
+ vertical-align: middle;
584
+ }
585
+
586
+ span.success { background: #efffed; color: #1a5e2a; border-color: #5ab85a; }
587
+ span.info { background: #e8f4fd; color: #1a4a70; border-color: #5a9fd4; }
588
+ span.warning { background: #fff8e1; color: #7a5c00; border-color: #e0a820; }
589
+ span.danger { background: #fff0f0; color: #7a1a1a; border-color: #d45a5a; }
590
+
591
+ /* --------------------------------------------------------------------------
592
+ YouTube embed — 16:9 responsive wrapper (structural, not decorative)
593
+ -------------------------------------------------------------------------- */
594
+
595
+ div.youtube-embed {
596
+ position: relative;
597
+ overflow: hidden;
598
+ height: 0;
599
+ padding-bottom: 56.25%; /* 16:9 ratio */
600
+ background: #e8e8e8;
601
+ }
602
+
603
+ div.youtube-embed iframe {
604
+ position: absolute;
605
+ inset: 0;
606
+ width: 100%;
607
+ height: 100%;
608
+ border: 0;
609
+ }
610
+
611
+ /* --------------------------------------------------------------------------
612
+ Mermaid diagram container
613
+ -------------------------------------------------------------------------- */
614
+
615
+ div.mermaid {
616
+ overflow-x: auto;
617
+ text-align: center;
618
+ padding: 1rem;
619
+ border: 1px solid #ddd;
620
+ background: #fafafa;
621
+ }
622
+
623
+ div.mermaid svg { max-width: 100%; height: auto; }
624
+
625
+ /* --------------------------------------------------------------------------
626
+ Focus indicators
627
+ -------------------------------------------------------------------------- */
628
+
629
+ a:focus-visible,
630
+ .tabs-bar-btn:focus-visible,
631
+ details.spoil > summary:focus-visible {
632
+ outline: 2px solid #0060cc;
633
+ outline-offset: 2px;
634
+ }
635
+
636
+ .task-list-item-checkbox:focus-visible,
637
+ .task-list-item input[type='checkbox']:focus-visible {
638
+ outline: 2px solid #0060cc;
639
+ outline-offset: 2px;
640
+ }
641
+
642
+ /* --------------------------------------------------------------------------
643
+ Responsive
644
+ -------------------------------------------------------------------------- */
645
+
646
+ @media (max-width: 600px) {
647
+ .markdown-body { padding: 1rem; }
648
+ .left { float: none; max-width: 100%; margin: 0 0 1rem; }
649
+ .cols { grid-template-columns: 1fr; }
650
+ }
651
+
652
+ @media print {
653
+ body { padding: 0; background: #fff; }
654
+ .markdown-body { max-width: 100%; padding: 0; border: 0; }
655
+ a { color: #0b57d0; }
656
+ .header-anchor { display: none !important; }
657
+ div.youtube-embed { display: none !important; }
658
+ }