starlight-theme-nova 0.0.5 → 0.0.7

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.
package/lib/shiki.css CHANGED
@@ -1,4 +1,4 @@
1
- @import '@shikijs/twoslash/style-rich.css';
1
+ @import 'shiki-twoslash-renderer/style.css';
2
2
 
3
3
  .sl-markdown-content .astro-code {
4
4
  padding: 0;
@@ -59,7 +59,7 @@
59
59
  background-color: var(--shiki-light-bg);
60
60
  }
61
61
 
62
- html.dark .astro-code {
62
+ html[data-theme='dark'] .astro-code {
63
63
  --twoslash-popup-bg: var(--shiki-dark-bg);
64
64
  background-color: var(--shiki-dark-bg);
65
65
  }
@@ -72,14 +72,14 @@ html.dark .astro-code {
72
72
  text-decoration: var(--shiki-light-text-decoration);
73
73
  }
74
74
 
75
- html.dark .astro-code,
76
- html.dark .astro-code span {
75
+ html[data-theme='dark'] .astro-code,
76
+ html[data-theme='dark'] .astro-code span {
77
77
  color: var(--shiki-dark);
78
78
  font-style: var(--shiki-dark-font-style);
79
79
  font-weight: var(--shiki-dark-font-weight);
80
80
  text-decoration: var(--shiki-dark-text-decoration);
81
81
  }
82
-
82
+ /*
83
83
  .astro-code.twoslash .twoslash-popup-container {
84
84
  transform: translateY(1.8em);
85
85
  }
@@ -90,4 +90,4 @@ html.dark .astro-code span {
90
90
 
91
91
  .astro-code.twoslash .twoslash-query-line .twoslash-popup-container {
92
92
  transform: translateY(1.3em);
93
- }
93
+ } */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "starlight-theme-nova",
3
3
  "type": "module",
4
- "version": "0.0.5",
4
+ "version": "0.0.7",
5
5
  "description": "",
6
6
  "author": "ocavue <ocavue@gmail.com>",
7
7
  "license": "MIT",
@@ -29,11 +29,12 @@
29
29
  "@shikijs/transformers": "^3.2.1",
30
30
  "@shikijs/twoslash": "^3.2.1",
31
31
  "@shikijs/types": "^3.2.1",
32
- "astro-theme-toggle": "^0.5.1",
33
- "hast-util-is-element": "^3.0.0"
32
+ "astro-theme-toggle": "^0.6.0",
33
+ "hast-util-is-element": "^3.0.0",
34
+ "shiki-twoslash-renderer": "0.0.2"
34
35
  },
35
36
  "devDependencies": {
36
- "@astrojs/starlight": "^0.32.2",
37
+ "@astrojs/starlight": "^0.32.3",
37
38
  "@iconify-json/bxl": "^1.2.2",
38
39
  "@iconify-json/logos": "^1.2.4",
39
40
  "@iconify-json/lucide": "^1.2.30",
@@ -41,7 +42,7 @@
41
42
  "@ocavue/tsconfig": "^0.2.0",
42
43
  "@types/node": "^20.17.24",
43
44
  "@unocss/cli": "^66.0.0",
44
- "astro": "^5.5.2",
45
+ "astro": "^5.5.3",
45
46
  "typescript": "^5.7.2",
46
47
  "unocss": "^66.0.0",
47
48
  "unocss-preset-animations": "^1.1.1"
package/src/astro.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  declare module '*.astro' {
2
- import { type AstroComponentFactory } from 'astro/runtime/server/index.js'
2
+ import type { AstroComponentFactory } from 'astro/runtime/server/index.js'
3
3
 
4
4
  const content: AstroComponentFactory
5
5
  export default content
@@ -14,3 +14,7 @@ import CodeCopy from './CodeCopy.astro'
14
14
  </style>
15
15
 
16
16
  <CodeCopy />
17
+ <script>
18
+ import { register } from 'shiki-twoslash-renderer/elements'
19
+ register()
20
+ </script>
@@ -6,6 +6,7 @@ import {
6
6
  import { transformerTwoslash } from '@shikijs/twoslash'
7
7
  import type { ShikiTransformer } from '@shikijs/types'
8
8
  import type { ShikiConfig } from 'astro'
9
+ import { createRenderer } from 'shiki-twoslash-renderer'
9
10
 
10
11
  import { transformerCopyButton } from './shiki-transformer-copy-button'
11
12
 
@@ -17,6 +18,7 @@ export function createShikiConfig(options: { twoslash: boolean }): ShikiConfig {
17
18
  transformerCopyButton(),
18
19
  options.twoslash
19
20
  ? transformerTwoslash({
21
+ renderer: createRenderer(),
20
22
  explicitTrigger: true,
21
23
  })
22
24
  : undefined,
@@ -28,7 +30,6 @@ export function createShikiConfig(options: { twoslash: boolean }): ShikiConfig {
28
30
  dark: 'github-dark-dimmed',
29
31
  },
30
32
  defaultColor: false,
31
- // @ts-expect-error: Astro is using outdated Shiki v1
32
33
  transformers: transformers,
33
34
  }
34
35
  }