@superlc/md-core 0.1.0 → 0.1.1

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.
Files changed (2) hide show
  1. package/dist/styles.css +78 -0
  2. package/package.json +9 -9
package/dist/styles.css CHANGED
@@ -514,6 +514,84 @@
514
514
  color: inherit;
515
515
  }
516
516
 
517
+ /* ========================================
518
+ 代码块复制按钮
519
+ ======================================== */
520
+ :root,
521
+ .md-light {
522
+ --md-copy-button-bg: rgba(0, 0, 0, 0.05);
523
+ --md-copy-button-bg-hover: rgba(0, 0, 0, 0.1);
524
+ --md-copy-button-color: var(--md-color-text-muted);
525
+ --md-copy-button-color-hover: var(--md-color-text);
526
+ --md-copy-button-success: #22c55e;
527
+ }
528
+
529
+ @media (prefers-color-scheme: dark) {
530
+ :root:not(.md-light) {
531
+ --md-copy-button-bg: rgba(255, 255, 255, 0.1);
532
+ --md-copy-button-bg-hover: rgba(255, 255, 255, 0.2);
533
+ --md-copy-button-color: var(--md-color-text-muted);
534
+ --md-copy-button-color-hover: var(--md-color-text);
535
+ --md-copy-button-success: #22c55e;
536
+ }
537
+ }
538
+
539
+ .md-dark {
540
+ --md-copy-button-bg: rgba(255, 255, 255, 0.1);
541
+ --md-copy-button-bg-hover: rgba(255, 255, 255, 0.2);
542
+ --md-copy-button-color: var(--md-color-text-muted);
543
+ --md-copy-button-color-hover: var(--md-color-text);
544
+ --md-copy-button-success: #22c55e;
545
+ }
546
+
547
+ .md-code-block-wrapper {
548
+ position: relative;
549
+ }
550
+
551
+ .md-code-block-wrapper pre {
552
+ margin: 0;
553
+ }
554
+
555
+ .md-copy-button {
556
+ position: absolute;
557
+ top: 8px;
558
+ right: 8px;
559
+ display: flex;
560
+ align-items: center;
561
+ justify-content: center;
562
+ width: 28px;
563
+ height: 28px;
564
+ padding: 0;
565
+ border: none;
566
+ border-radius: var(--md-radius-sm);
567
+ background-color: transparent;
568
+ color: var(--md-copy-button-color);
569
+ cursor: pointer;
570
+ opacity: 0.6;
571
+ transition: opacity 0.2s, background-color 0.2s, color 0.2s;
572
+ }
573
+
574
+ .md-copy-button:hover {
575
+ opacity: 1;
576
+ }
577
+
578
+ .md-copy-button:active {
579
+ transform: scale(0.95);
580
+ }
581
+
582
+ .md-copy-button--copied {
583
+ color: var(--md-copy-button-success);
584
+ }
585
+
586
+ .md-copy-button--copied:hover {
587
+ color: var(--md-copy-button-success);
588
+ }
589
+
590
+ .md-copy-button svg {
591
+ width: 14px;
592
+ height: 14px;
593
+ }
594
+
517
595
  /* ========================================
518
596
  KaTeX 错误样式覆盖
519
597
  ======================================== */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superlc/md-core",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "基于 unified 的 Markdown 解析核心库",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -17,12 +17,6 @@
17
17
  "files": [
18
18
  "dist"
19
19
  ],
20
- "scripts": {
21
- "build": "vite build",
22
- "dev": "vite build --watch",
23
- "test": "vitest",
24
- "test:run": "vitest run"
25
- },
26
20
  "dependencies": {
27
21
  "@types/hast": "^3.0.0",
28
22
  "@types/mdast": "^4.0.0",
@@ -56,5 +50,11 @@
56
50
  "rehype",
57
51
  "parser"
58
52
  ],
59
- "license": "MIT"
60
- }
53
+ "license": "MIT",
54
+ "scripts": {
55
+ "build": "vite build",
56
+ "dev": "vite build --watch",
57
+ "test": "vitest",
58
+ "test:run": "vitest run"
59
+ }
60
+ }