@uiw/copy-to-clipboard 1.0.18 → 1.0.20

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,1047 +0,0 @@
1
- /**
2
- * Markdown Style
3
- * @version 1.1.0
4
- * @author 小弟调调
5
- * https://github.com/jaywcjlove/markdown-style
6
- *
7
- * Integrate markdown styles into web components, Markdown CSS styles will not be conflicted.
8
- * The minimal amount of CSS to replicate the GitHub Markdown style. Support dark-mode/night mode.
9
- */
10
- const octiconLinkStyle = `
11
- markdown-style h1:hover a.anchor .icon-link:before,
12
- markdown-style h2:hover a.anchor .icon-link:before,
13
- markdown-style h3:hover a.anchor .icon-link:before,
14
- markdown-style h4:hover a.anchor .icon-link:before,
15
- markdown-style h5:hover a.anchor .icon-link:before,
16
- markdown-style h6:hover a.anchor .icon-link:before {
17
- width: 16px;
18
- height: 16px;
19
- content: ' ';
20
- display: inline-block;
21
- background-color: currentColor;
22
- -webkit-mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' version='1.1' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg>");
23
- mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' version='1.1' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg>");
24
- }`;
25
-
26
- const __TEMPLATE__ = document.createElement('template');
27
- __TEMPLATE__.innerHTML = `
28
- <style>
29
- ${octiconLinkStyle}
30
- [data-color-mode*='light'], [data-color-mode*='light'] body, markdown-style[theme*='light'] {
31
- --color-prettylights-syntax-comment: #6e7781;
32
- --color-prettylights-syntax-constant: #0550ae;
33
- --color-prettylights-syntax-entity: #8250df;
34
- --color-prettylights-syntax-storage-modifier-import: #24292f;
35
- --color-prettylights-syntax-entity-tag: #116329;
36
- --color-prettylights-syntax-keyword: #cf222e;
37
- --color-prettylights-syntax-string: #0a3069;
38
- --color-prettylights-syntax-variable: #953800;
39
- --color-prettylights-syntax-brackethighlighter-unmatched: #82071e;
40
- --color-prettylights-syntax-invalid-illegal-text: #f6f8fa;
41
- --color-prettylights-syntax-invalid-illegal-bg: #82071e;
42
- --color-prettylights-syntax-carriage-return-text: #f6f8fa;
43
- --color-prettylights-syntax-carriage-return-bg: #cf222e;
44
- --color-prettylights-syntax-string-regexp: #116329;
45
- --color-prettylights-syntax-markup-list: #3b2300;
46
- --color-prettylights-syntax-markup-heading: #0550ae;
47
- --color-prettylights-syntax-markup-italic: #24292f;
48
- --color-prettylights-syntax-markup-bold: #24292f;
49
- --color-prettylights-syntax-markup-deleted-text: #82071e;
50
- --color-prettylights-syntax-markup-deleted-bg: #FFEBE9;
51
- --color-prettylights-syntax-markup-inserted-text: #116329;
52
- --color-prettylights-syntax-markup-inserted-bg: #dafbe1;
53
- --color-prettylights-syntax-markup-changed-text: #953800;
54
- --color-prettylights-syntax-markup-changed-bg: #ffd8b5;
55
- --color-prettylights-syntax-markup-ignored-text: #eaeef2;
56
- --color-prettylights-syntax-markup-ignored-bg: #0550ae;
57
- --color-prettylights-syntax-meta-diff-range: #8250df;
58
- --color-prettylights-syntax-brackethighlighter-angle: #57606a;
59
- --color-prettylights-syntax-sublimelinter-gutter-mark: #8c959f;
60
- --color-prettylights-syntax-constant-other-reference-link: #0a3069;
61
- --color-fg-default: #24292f;
62
- --color-fg-muted: #57606a;
63
- --color-fg-subtle: #6e7781;
64
- --color-canvas-default: #ffffff;
65
- --color-canvas-subtle: #f6f8fa;
66
- --color-border-default: #d0d7de;
67
- --color-border-muted: hsla(210,18%,87%,1);
68
- --color-neutral-muted: rgba(175,184,193,0.2);
69
- --color-accent-fg: #0969da;
70
- --color-accent-emphasis: #0969da;
71
- --color-attention-subtle: #fff8c5;
72
- --color-danger-fg: #cf222e;
73
- }
74
- [data-color-mode*='dark'], [data-color-mode*='dark'] body, markdown-style[theme*='dark'] {
75
- --color-prettylights-syntax-comment: #8b949e;
76
- --color-prettylights-syntax-constant: #79c0ff;
77
- --color-prettylights-syntax-entity: #d2a8ff;
78
- --color-prettylights-syntax-storage-modifier-import: #c9d1d9;
79
- --color-prettylights-syntax-entity-tag: #7ee787;
80
- --color-prettylights-syntax-keyword: #ff7b72;
81
- --color-prettylights-syntax-string: #a5d6ff;
82
- --color-prettylights-syntax-variable: #ffa657;
83
- --color-prettylights-syntax-brackethighlighter-unmatched: #f85149;
84
- --color-prettylights-syntax-invalid-illegal-text: #f0f6fc;
85
- --color-prettylights-syntax-invalid-illegal-bg: #8e1519;
86
- --color-prettylights-syntax-carriage-return-text: #f0f6fc;
87
- --color-prettylights-syntax-carriage-return-bg: #b62324;
88
- --color-prettylights-syntax-string-regexp: #7ee787;
89
- --color-prettylights-syntax-markup-list: #f2cc60;
90
- --color-prettylights-syntax-markup-heading: #1f6feb;
91
- --color-prettylights-syntax-markup-italic: #c9d1d9;
92
- --color-prettylights-syntax-markup-bold: #c9d1d9;
93
- --color-prettylights-syntax-markup-deleted-text: #ffdcd7;
94
- --color-prettylights-syntax-markup-deleted-bg: #67060c;
95
- --color-prettylights-syntax-markup-inserted-text: #aff5b4;
96
- --color-prettylights-syntax-markup-inserted-bg: #033a16;
97
- --color-prettylights-syntax-markup-changed-text: #ffdfb6;
98
- --color-prettylights-syntax-markup-changed-bg: #5a1e02;
99
- --color-prettylights-syntax-markup-ignored-text: #c9d1d9;
100
- --color-prettylights-syntax-markup-ignored-bg: #1158c7;
101
- --color-prettylights-syntax-meta-diff-range: #d2a8ff;
102
- --color-prettylights-syntax-brackethighlighter-angle: #8b949e;
103
- --color-prettylights-syntax-sublimelinter-gutter-mark: #484f58;
104
- --color-prettylights-syntax-constant-other-reference-link: #a5d6ff;
105
- --color-fg-default: #c9d1d9;
106
- --color-fg-muted: #8b949e;
107
- --color-fg-subtle: #484f58;
108
- --color-canvas-default: #0d1117;
109
- --color-canvas-subtle: #161b22;
110
- --color-border-default: #30363d;
111
- --color-border-muted: #21262d;
112
- --color-neutral-muted: rgba(110,118,129,0.4);
113
- --color-accent-fg: #58a6ff;
114
- --color-accent-emphasis: #1f6feb;
115
- --color-attention-subtle: rgba(187,128,9,0.15);
116
- --color-danger-fg: #f85149;
117
- }
118
-
119
- markdown-style {
120
- display: block;
121
- -webkit-text-size-adjust: 100%;
122
- font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";
123
- font-size: 16px;
124
- line-height: 1.5;
125
- word-wrap: break-word;
126
- color: var(--color-fg-default);
127
- background-color: var(--color-canvas-default);
128
- }
129
-
130
- markdown-style details,
131
- markdown-style figcaption,
132
- markdown-style figure {
133
- display: block;
134
- }
135
-
136
- markdown-style summary {
137
- display: list-item;
138
- }
139
-
140
- markdown-style [hidden] {
141
- display: none !important;
142
- }
143
-
144
- markdown-style a {
145
- background-color: transparent;
146
- color: var(--color-accent-fg);
147
- text-decoration: none;
148
- }
149
-
150
- markdown-style a:active,
151
- markdown-style a:hover {
152
- outline-width: 0;
153
- }
154
-
155
- markdown-style abbr[title] {
156
- border-bottom: none;
157
- text-decoration: underline dotted;
158
- }
159
-
160
- markdown-style b,
161
- markdown-style strong {
162
- font-weight: 600;
163
- }
164
-
165
- markdown-style dfn {
166
- font-style: italic;
167
- }
168
-
169
- markdown-style h1 {
170
- margin: .67em 0;
171
- font-weight: 600;
172
- padding-bottom: .3em;
173
- font-size: 2em;
174
- border-bottom: 1px solid var(--color-border-muted);
175
- }
176
-
177
- markdown-style mark {
178
- background-color: var(--color-attention-subtle);
179
- color: var(--color-text-primary);
180
- }
181
-
182
- markdown-style small {
183
- font-size: 90%;
184
- }
185
-
186
- markdown-style sub,
187
- markdown-style sup {
188
- font-size: 75%;
189
- line-height: 0;
190
- position: relative;
191
- vertical-align: baseline;
192
- }
193
-
194
- markdown-style sub {
195
- bottom: -0.25em;
196
- }
197
-
198
- markdown-style sup {
199
- top: -0.5em;
200
- }
201
-
202
- markdown-style img {
203
- border-style: none;
204
- max-width: 100%;
205
- box-sizing: content-box;
206
- background-color: var(--color-canvas-default);
207
- }
208
-
209
- markdown-style code,
210
- markdown-style kbd,
211
- markdown-style pre,
212
- markdown-style samp {
213
- font-family: monospace,monospace;
214
- font-size: 1em;
215
- }
216
-
217
- markdown-style figure {
218
- margin: 1em 40px;
219
- }
220
-
221
- markdown-style hr {
222
- box-sizing: content-box;
223
- overflow: hidden;
224
- background: transparent;
225
- border-bottom: 1px solid var(--color-border-muted);
226
- height: .25em;
227
- padding: 0;
228
- margin: 24px 0;
229
- background-color: var(--color-border-default);
230
- border: 0;
231
- }
232
-
233
- markdown-style input {
234
- font: inherit;
235
- margin: 0;
236
- overflow: visible;
237
- font-family: inherit;
238
- font-size: inherit;
239
- line-height: inherit;
240
- }
241
-
242
- markdown-style [type=button],
243
- markdown-style [type=reset],
244
- markdown-style [type=submit] {
245
- -webkit-appearance: button;
246
- }
247
-
248
- markdown-style [type=button]::-moz-focus-inner,
249
- markdown-style [type=reset]::-moz-focus-inner,
250
- markdown-style [type=submit]::-moz-focus-inner {
251
- border-style: none;
252
- padding: 0;
253
- }
254
-
255
- markdown-style [type=button]:-moz-focusring,
256
- markdown-style [type=reset]:-moz-focusring,
257
- markdown-style [type=submit]:-moz-focusring {
258
- outline: 1px dotted ButtonText;
259
- }
260
-
261
- markdown-style [type=checkbox],
262
- markdown-style [type=radio] {
263
- box-sizing: border-box;
264
- padding: 0;
265
- }
266
-
267
- markdown-style [type=number]::-webkit-inner-spin-button,
268
- markdown-style [type=number]::-webkit-outer-spin-button {
269
- height: auto;
270
- }
271
-
272
- markdown-style [type=search] {
273
- -webkit-appearance: textfield;
274
- outline-offset: -2px;
275
- }
276
-
277
- markdown-style [type=search]::-webkit-search-cancel-button,
278
- markdown-style [type=search]::-webkit-search-decoration {
279
- -webkit-appearance: none;
280
- }
281
-
282
- markdown-style ::-webkit-input-placeholder {
283
- color: inherit;
284
- opacity: .54;
285
- }
286
-
287
- markdown-style ::-webkit-file-upload-button {
288
- -webkit-appearance: button;
289
- font: inherit;
290
- }
291
-
292
- markdown-style a:hover {
293
- text-decoration: underline;
294
- }
295
-
296
- markdown-style hr::before {
297
- display: table;
298
- content: "";
299
- }
300
-
301
- markdown-style hr::after {
302
- display: table;
303
- clear: both;
304
- content: "";
305
- }
306
-
307
- markdown-style table {
308
- border-spacing: 0;
309
- border-collapse: collapse;
310
- display: block;
311
- width: max-content;
312
- max-width: 100%;
313
- overflow: auto;
314
- }
315
-
316
- markdown-style td,
317
- markdown-style th {
318
- padding: 0;
319
- }
320
-
321
- markdown-style details summary {
322
- cursor: pointer;
323
- }
324
-
325
- markdown-style details:not([open])>*:not(summary) {
326
- display: none !important;
327
- }
328
-
329
- markdown-style kbd {
330
- display: inline-block;
331
- padding: 3px 5px;
332
- font: 11px ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;
333
- line-height: 10px;
334
- color: var(--color-fg-default);
335
- vertical-align: middle;
336
- background-color: var(--color-canvas-subtle);
337
- border: solid 1px var(--color-neutral-muted);
338
- border-bottom-color: var(--color-neutral-muted);
339
- border-radius: 6px;
340
- box-shadow: inset 0 -1px 0 var(--color-neutral-muted);
341
- }
342
-
343
- markdown-style h1,
344
- markdown-style h2,
345
- markdown-style h3,
346
- markdown-style h4,
347
- markdown-style h5,
348
- markdown-style h6 {
349
- margin-top: 24px;
350
- margin-bottom: 16px;
351
- font-weight: 600;
352
- line-height: 1.25;
353
- }
354
-
355
- markdown-style h2 {
356
- font-weight: 600;
357
- padding-bottom: .3em;
358
- font-size: 1.5em;
359
- border-bottom: 1px solid var(--color-border-muted);
360
- }
361
-
362
- markdown-style h3 {
363
- font-weight: 600;
364
- font-size: 1.25em;
365
- }
366
-
367
- markdown-style h4 {
368
- font-weight: 600;
369
- font-size: 1em;
370
- }
371
-
372
- markdown-style h5 {
373
- font-weight: 600;
374
- font-size: .875em;
375
- }
376
-
377
- markdown-style h6 {
378
- font-weight: 600;
379
- font-size: .85em;
380
- color: var(--color-fg-muted);
381
- }
382
-
383
- markdown-style p {
384
- margin-top: 0;
385
- margin-bottom: 10px;
386
- }
387
-
388
- markdown-style blockquote {
389
- margin: 0;
390
- padding: 0 1em;
391
- color: var(--color-fg-muted);
392
- border-left: .25em solid var(--color-border-default);
393
- }
394
-
395
- markdown-style ul,
396
- markdown-style ol {
397
- margin-top: 0;
398
- margin-bottom: 0;
399
- padding-left: 2em;
400
- }
401
-
402
- markdown-style ol ol,
403
- markdown-style ul ol {
404
- list-style-type: lower-roman;
405
- }
406
-
407
- markdown-style ul ul ol,
408
- markdown-style ul ol ol,
409
- markdown-style ol ul ol,
410
- markdown-style ol ol ol {
411
- list-style-type: lower-alpha;
412
- }
413
-
414
- markdown-style dd {
415
- margin-left: 0;
416
- }
417
-
418
- markdown-style tt,
419
- markdown-style code {
420
- font-family: ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;
421
- font-size: 12px;
422
- }
423
-
424
- markdown-style pre {
425
- margin-top: 0;
426
- margin-bottom: 0;
427
- font-family: ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;
428
- font-size: 12px;
429
- word-wrap: normal;
430
- }
431
-
432
- markdown-style .octicon {
433
- display: inline-block;
434
- overflow: visible !important;
435
- vertical-align: text-bottom;
436
- fill: currentColor;
437
- }
438
-
439
- markdown-style ::placeholder {
440
- color: var(--color-fg-subtle);
441
- opacity: 1;
442
- }
443
-
444
- markdown-style input::-webkit-outer-spin-button,
445
- markdown-style input::-webkit-inner-spin-button {
446
- margin: 0;
447
- -webkit-appearance: none;
448
- appearance: none;
449
- }
450
-
451
- markdown-style .token.comment, markdown-style .token.prolog, markdown-style .token.doctype, markdown-style .token.cdata {
452
- color: var(--color-prettylights-syntax-comment);
453
- }
454
- markdown-style .token.namespace { opacity: 0.7; }
455
- markdown-style .token.tag, markdown-style .token.selector, markdown-style .token.constant, markdown-style .token.symbol, markdown-style .token.deleted {
456
- color: var(--color-prettylights-syntax-entity-tag);
457
- }
458
- markdown-style .token.maybe-class-name {
459
- color: var(--color-prettylights-syntax-variable);
460
- }
461
- markdown-style .token.property-access, markdown-style .token.operator, markdown-style .token.boolean, markdown-style .token.number, markdown-style .token.selector markdown-style .token.class, markdown-style .token.attr-name, markdown-style .token.string, markdown-style .token.char, markdown-style .token.builtin {
462
- color: var(--color-prettylights-syntax-constant);
463
- }
464
-
465
- markdown-style .token.deleted {
466
- color: var(--color-prettylights-syntax-markup-deleted-text);
467
- }
468
- markdown-style .token.property {
469
- color: var(--color-prettylights-syntax-constant);
470
- }
471
- markdown-style .token.punctuation {
472
- color: var(--color-prettylights-syntax-markup-bold);
473
- }
474
- markdown-style .token.function {
475
- color: var(--color-prettylights-syntax-entity);
476
- }
477
- markdown-style .code-line .token.deleted {
478
- background-color: var(--color-prettylights-syntax-markup-deleted-bg);
479
- }
480
- markdown-style .token.inserted {
481
- color: var(--color-prettylights-syntax-markup-inserted-text);
482
- }
483
- markdown-style .code-line .token.inserted {
484
- background-color: var(--color-prettylights-syntax-markup-inserted-bg);
485
- }
486
-
487
- markdown-style .token.variable {
488
- color: var(--color-prettylights-syntax-constant);
489
- }
490
- markdown-style .token.entity, markdown-style .token.url, .language-css markdown-style .token.string, .style markdown-style .token.string {
491
- color: var(--color-prettylights-syntax-string);
492
- }
493
- markdown-style .token.color, markdown-style .token.atrule, markdown-style .token.attr-value, markdown-style .token.function, markdown-style .token.class-name {
494
- color: var(--color-prettylights-syntax-string);
495
- }
496
- markdown-style .token.rule, markdown-style .token.regex, markdown-style .token.important, markdown-style .token.keyword {
497
- color: var(--color-prettylights-syntax-keyword);
498
- }
499
- markdown-style .token.coord {
500
- color: var(--color-prettylights-syntax-meta-diff-range);
501
- }
502
- markdown-style .token.important, markdown-style .token.bold { font-weight: bold; }
503
- markdown-style .token.italic { font-style: italic; }
504
- markdown-style .token.entity { cursor: help; }
505
-
506
- markdown-style [data-catalyst] {
507
- display: block;
508
- }
509
-
510
- markdown-style g-emoji {
511
- font-family: "Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";
512
- font-size: 1em;
513
- font-style: normal !important;
514
- font-weight: 400;
515
- line-height: 1;
516
- vertical-align: -0.075em;
517
- }
518
-
519
- markdown-style g-emoji img {
520
- width: 1em;
521
- height: 1em;
522
- }
523
-
524
- markdown-style::before {
525
- display: table;
526
- content: "";
527
- }
528
-
529
- markdown-style::after {
530
- display: table;
531
- clear: both;
532
- content: "";
533
- }
534
-
535
- markdown-style>*:first-child {
536
- margin-top: 0 !important;
537
- }
538
-
539
- markdown-style>*:last-child {
540
- margin-bottom: 0 !important;
541
- }
542
-
543
- markdown-style a:not([href]) {
544
- color: inherit;
545
- text-decoration: none;
546
- }
547
-
548
- markdown-style .absent {
549
- color: var(--color-danger-fg);
550
- }
551
-
552
- markdown-style a.anchor {
553
- float: left;
554
- padding-right: 4px;
555
- margin-left: -20px;
556
- line-height: 1;
557
- }
558
-
559
- markdown-style a.anchor:focus {
560
- outline: none;
561
- }
562
-
563
- markdown-style p,
564
- markdown-style blockquote,
565
- markdown-style ul,
566
- markdown-style ol,
567
- markdown-style dl,
568
- markdown-style table,
569
- markdown-style pre,
570
- markdown-style details {
571
- margin-top: 0;
572
- margin-bottom: 16px;
573
- }
574
-
575
- markdown-style blockquote>:first-child {
576
- margin-top: 0;
577
- }
578
-
579
- markdown-style blockquote>:last-child {
580
- margin-bottom: 0;
581
- }
582
-
583
- markdown-style sup>a::before {
584
- content: "[";
585
- }
586
-
587
- markdown-style sup>a::after {
588
- content: "]";
589
- }
590
- markdown-style .octicon-video .octicon.octicon-device-camera-video {
591
- margin: 0 0.5rem 0 0.25rem;
592
- }
593
- markdown-style .octicon-video {
594
- border: 1px solid var(--color-border-default) !important;
595
- border-radius: 6px !important;
596
- display: block;
597
- }
598
-
599
- markdown-style .octicon-video summary {
600
- border-bottom: 1px solid var(--color-border-default) !important;
601
- padding: 8px 16px !important;
602
- cursor: pointer;
603
- }
604
-
605
- markdown-style .octicon-video > video {
606
- display: block !important;
607
- max-width: 100% !important;
608
- padding: 2px;
609
- box-sizing: border-box;
610
- border-bottom-right-radius: 6px !important;
611
- border-bottom-left-radius: 6px !important;
612
- }
613
-
614
- markdown-style details.octicon-video:not([open])>*:not(summary) {
615
- display: none !important;
616
- }
617
-
618
- markdown-style details.octicon-video:not([open]) > summary {
619
- border-bottom: 0 !important;
620
- }
621
-
622
- markdown-style h1 .octicon-link,
623
- markdown-style h2 .octicon-link,
624
- markdown-style h3 .octicon-link,
625
- markdown-style h4 .octicon-link,
626
- markdown-style h5 .octicon-link,
627
- markdown-style h6 .octicon-link {
628
- color: var(--color-fg-default);
629
- vertical-align: middle;
630
- visibility: hidden;
631
- }
632
-
633
- markdown-style h1:hover .anchor,
634
- markdown-style h2:hover .anchor,
635
- markdown-style h3:hover .anchor,
636
- markdown-style h4:hover .anchor,
637
- markdown-style h5:hover .anchor,
638
- markdown-style h6:hover .anchor {
639
- text-decoration: none;
640
- }
641
-
642
- markdown-style h1:hover .anchor .octicon-link,
643
- markdown-style h2:hover .anchor .octicon-link,
644
- markdown-style h3:hover .anchor .octicon-link,
645
- markdown-style h4:hover .anchor .octicon-link,
646
- markdown-style h5:hover .anchor .octicon-link,
647
- markdown-style h6:hover .anchor .octicon-link {
648
- visibility: visible;
649
- }
650
-
651
- markdown-style h1 tt,
652
- markdown-style h1 code,
653
- markdown-style h2 tt,
654
- markdown-style h2 code,
655
- markdown-style h3 tt,
656
- markdown-style h3 code,
657
- markdown-style h4 tt,
658
- markdown-style h4 code,
659
- markdown-style h5 tt,
660
- markdown-style h5 code,
661
- markdown-style h6 tt,
662
- markdown-style h6 code {
663
- padding: 0 .2em;
664
- font-size: inherit;
665
- }
666
-
667
- markdown-style ul.no-list,
668
- markdown-style ol.no-list {
669
- padding: 0;
670
- list-style-type: none;
671
- }
672
-
673
- markdown-style ol[type="1"] {
674
- list-style-type: decimal;
675
- }
676
-
677
- markdown-style ol[type=a] {
678
- list-style-type: lower-alpha;
679
- }
680
-
681
- markdown-style ol[type=i] {
682
- list-style-type: lower-roman;
683
- }
684
-
685
- markdown-style div>ol:not([type]) {
686
- list-style-type: decimal;
687
- }
688
-
689
- markdown-style ul ul,
690
- markdown-style ul ol,
691
- markdown-style ol ol,
692
- markdown-style ol ul {
693
- margin-top: 0;
694
- margin-bottom: 0;
695
- }
696
-
697
- markdown-style li>p {
698
- margin-top: 16px;
699
- }
700
-
701
- markdown-style li+li {
702
- margin-top: .25em;
703
- }
704
-
705
- markdown-style dl {
706
- padding: 0;
707
- }
708
-
709
- markdown-style dl dt {
710
- padding: 0;
711
- margin-top: 16px;
712
- font-size: 1em;
713
- font-style: italic;
714
- font-weight: 600;
715
- }
716
-
717
- markdown-style dl dd {
718
- padding: 0 16px;
719
- margin-bottom: 16px;
720
- }
721
-
722
- markdown-style table th {
723
- font-weight: 600;
724
- }
725
-
726
- markdown-style table th,
727
- markdown-style table td {
728
- padding: 6px 13px;
729
- border: 1px solid var(--color-border-default);
730
- }
731
-
732
- markdown-style table tr {
733
- background-color: var(--color-canvas-default);
734
- border-top: 1px solid var(--color-border-muted);
735
- }
736
-
737
- markdown-style table tr:nth-child(2n) {
738
- background-color: var(--color-canvas-subtle);
739
- }
740
-
741
- markdown-style table img {
742
- background-color: transparent;
743
- vertical-align: middle;
744
- }
745
-
746
- markdown-style img[align=right] {
747
- padding-left: 20px;
748
- }
749
-
750
- markdown-style img[align=left] {
751
- padding-right: 20px;
752
- }
753
-
754
- markdown-style .emoji {
755
- max-width: none;
756
- vertical-align: text-top;
757
- background-color: transparent;
758
- }
759
-
760
- markdown-style span.frame {
761
- display: block;
762
- overflow: hidden;
763
- }
764
-
765
- markdown-style span.frame>span {
766
- display: block;
767
- float: left;
768
- width: auto;
769
- padding: 7px;
770
- margin: 13px 0 0;
771
- overflow: hidden;
772
- border: 1px solid var(--color-border-default);
773
- }
774
-
775
- markdown-style span.frame span img {
776
- display: block;
777
- float: left;
778
- }
779
-
780
- markdown-style span.frame span span {
781
- display: block;
782
- padding: 5px 0 0;
783
- clear: both;
784
- color: var(--color-fg-default);
785
- }
786
-
787
- markdown-style span.align-center {
788
- display: block;
789
- overflow: hidden;
790
- clear: both;
791
- }
792
-
793
- markdown-style span.align-center>span {
794
- display: block;
795
- margin: 13px auto 0;
796
- overflow: hidden;
797
- text-align: center;
798
- }
799
-
800
- markdown-style span.align-center span img {
801
- margin: 0 auto;
802
- text-align: center;
803
- }
804
-
805
- markdown-style span.align-right {
806
- display: block;
807
- overflow: hidden;
808
- clear: both;
809
- }
810
-
811
- markdown-style span.align-right>span {
812
- display: block;
813
- margin: 13px 0 0;
814
- overflow: hidden;
815
- text-align: right;
816
- }
817
-
818
- markdown-style span.align-right span img {
819
- margin: 0;
820
- text-align: right;
821
- }
822
-
823
- markdown-style span.float-left {
824
- display: block;
825
- float: left;
826
- margin-right: 13px;
827
- overflow: hidden;
828
- }
829
-
830
- markdown-style span.float-left span {
831
- margin: 13px 0 0;
832
- }
833
-
834
- markdown-style span.float-right {
835
- display: block;
836
- float: right;
837
- margin-left: 13px;
838
- overflow: hidden;
839
- }
840
-
841
- markdown-style span.float-right>span {
842
- display: block;
843
- margin: 13px auto 0;
844
- overflow: hidden;
845
- text-align: right;
846
- }
847
-
848
- markdown-style code,
849
- markdown-style tt {
850
- padding: .2em .4em;
851
- margin: 0;
852
- font-size: 85%;
853
- background-color: var(--color-neutral-muted);
854
- border-radius: 6px;
855
- }
856
-
857
- markdown-style code br,
858
- markdown-style tt br {
859
- display: none;
860
- }
861
-
862
- markdown-style del code {
863
- text-decoration: inherit;
864
- }
865
-
866
- markdown-style pre code {
867
- font-size: 100%;
868
- }
869
-
870
- markdown-style pre>code {
871
- padding: 0;
872
- margin: 0;
873
- word-break: normal;
874
- white-space: pre;
875
- background: transparent;
876
- border: 0;
877
- }
878
-
879
- markdown-style pre {
880
- position: relative;
881
- font-size: 85%;
882
- line-height: 1.45;
883
- background-color: var(--color-canvas-subtle);
884
- border-radius: 6px;
885
- }
886
-
887
- markdown-style pre code,
888
- markdown-style pre tt {
889
- display: inline;
890
- max-width: auto;
891
- padding: 0;
892
- margin: 0;
893
- overflow: visible;
894
- line-height: inherit;
895
- word-wrap: normal;
896
- background-color: transparent;
897
- border: 0;
898
- }
899
-
900
- markdown-style pre > code {
901
- padding: 16px;
902
- overflow: auto;
903
- display: block;
904
- }
905
-
906
- markdown-style .csv-data td,
907
- markdown-style .csv-data th {
908
- padding: 5px;
909
- overflow: hidden;
910
- font-size: 12px;
911
- line-height: 1;
912
- text-align: left;
913
- white-space: nowrap;
914
- }
915
-
916
- markdown-style .csv-data .blob-num {
917
- padding: 10px 8px 9px;
918
- text-align: right;
919
- background: var(--color-canvas-default);
920
- border: 0;
921
- }
922
-
923
- markdown-style .csv-data tr {
924
- border-top: 0;
925
- }
926
-
927
- markdown-style .csv-data th {
928
- font-weight: 600;
929
- background: var(--color-canvas-subtle);
930
- border-top: 0;
931
- }
932
-
933
- markdown-style .footnotes {
934
- font-size: 12px;
935
- color: var(--color-fg-muted);
936
- border-top: 1px solid var(--color-border-default);
937
- }
938
-
939
- markdown-style .footnotes ol {
940
- padding-left: 16px;
941
- }
942
-
943
- markdown-style .footnotes li {
944
- position: relative;
945
- }
946
-
947
- markdown-style .footnotes li:target::before {
948
- position: absolute;
949
- top: -8px;
950
- right: -8px;
951
- bottom: -8px;
952
- left: -24px;
953
- pointer-events: none;
954
- content: "";
955
- border: 2px solid var(--color-accent-emphasis);
956
- border-radius: 6px;
957
- }
958
-
959
- markdown-style .footnotes li:target {
960
- color: var(--color-fg-default);
961
- }
962
-
963
- markdown-style .footnotes .data-footnote-backref g-emoji {
964
- font-family: monospace;
965
- }
966
-
967
- markdown-style .task-list-item {
968
- list-style-type: none;
969
- }
970
-
971
- markdown-style .task-list-item label {
972
- font-weight: 400;
973
- }
974
-
975
- markdown-style .task-list-item.enabled label {
976
- cursor: pointer;
977
- }
978
-
979
- markdown-style .task-list-item+.task-list-item {
980
- margin-top: 3px;
981
- }
982
-
983
- markdown-style .task-list-item .handle {
984
- display: none;
985
- }
986
-
987
- markdown-style .task-list-item-checkbox,
988
- markdown-style input[type="checkbox"] {
989
- margin: 0 .2em .25em -1.6em;
990
- vertical-align: middle;
991
- }
992
-
993
- markdown-style .contains-task-list:dir(rtl) .task-list-item-checkbox,
994
- markdown-style .contains-task-list:dir(rtl) input[type="checkbox"] {
995
- margin: 0 -1.6em .25em .2em;
996
- }
997
-
998
- markdown-style ::-webkit-calendar-picker-indicator {
999
- filter: invert(50%);
1000
- }
1001
- </style>
1002
- <slot></slot>
1003
- `;
1004
- class MarkdownStyle extends HTMLElement {
1005
- get theme() {
1006
- const value = this.getAttribute('theme');
1007
- return value === null ? '' : value;
1008
- }
1009
- set theme(name) {
1010
- this.setAttribute('theme', name);
1011
- }
1012
- constructor() {
1013
- super();
1014
- this.shadow = this.attachShadow({ mode: 'open' });
1015
- this.shadow.appendChild(__TEMPLATE__.content.cloneNode(true));
1016
- const style = Array.prototype.slice.call(this.shadow.children).find((item) => item.tagName === 'STYLE');
1017
- if (style) {
1018
- const id = '__MARKDOWN_STYLE__';
1019
- const findStyle = document.getElementById(id);
1020
- if (!findStyle) {
1021
- style.id = id;
1022
- document.head.append(style);
1023
- }
1024
- }
1025
- }
1026
- connectedCallback() {
1027
- const disableThemeAutoSwitch = this.getAttribute('theme-auto-switch-disabled');
1028
- if (disableThemeAutoSwitch == '' || (disableThemeAutoSwitch && disableThemeAutoSwitch.toLowerCase() === 'true')) {
1029
- return;
1030
- }
1031
- if (!this.theme) {
1032
- const { colorMode } = document.documentElement.dataset;
1033
- this.theme = colorMode;
1034
- const observer = new MutationObserver((mutationsList, observer) => {
1035
- this.theme = document.documentElement.dataset.colorMode;
1036
- });
1037
- observer.observe(document.documentElement, { attributes: true });
1038
- window.matchMedia('(prefers-color-scheme: light)').onchange = (event) => {
1039
- this.theme = event.matches ? 'light' : 'dark';
1040
- };
1041
- window.matchMedia('(prefers-color-scheme: dark)').onchange = (event) => {
1042
- this.theme = event.matches ? 'dark' : 'light';
1043
- };
1044
- }
1045
- }
1046
- }
1047
- customElements.define('markdown-style', MarkdownStyle);