starlight-theme-celestia 0.2.3 → 0.2.4
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/tailwind.gen.css +5 -11
- package/package.json +5 -4
- package/src/index.test.ts +11 -0
- package/src/index.ts +1 -1
- package/src/shiki-transformer-container.ts +25 -0
package/lib/tailwind.gen.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! tailwindcss v4.
|
|
1
|
+
/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
|
|
2
2
|
@layer properties;
|
|
3
3
|
@layer theme, base, components, utilities;
|
|
4
4
|
@layer theme {
|
|
@@ -244,12 +244,6 @@
|
|
|
244
244
|
.inset-0 {
|
|
245
245
|
inset: calc(var(--spacing) * 0);
|
|
246
246
|
}
|
|
247
|
-
.start {
|
|
248
|
-
inset-inline-start: var(--spacing);
|
|
249
|
-
}
|
|
250
|
-
.end {
|
|
251
|
-
inset-inline-end: var(--spacing);
|
|
252
|
-
}
|
|
253
247
|
.top-\(--sl-nav-height\) {
|
|
254
248
|
top: var(--sl-nav-height);
|
|
255
249
|
}
|
|
@@ -365,6 +359,10 @@
|
|
|
365
359
|
.transform {
|
|
366
360
|
transform: var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);
|
|
367
361
|
}
|
|
362
|
+
.celestia-scroll-container {
|
|
363
|
+
scrollbar-width: thin;
|
|
364
|
+
scrollbar-color: var(--sl-color-gray-5) transparent;
|
|
365
|
+
}
|
|
368
366
|
.flex-col {
|
|
369
367
|
flex-direction: column;
|
|
370
368
|
}
|
|
@@ -594,10 +592,6 @@
|
|
|
594
592
|
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
595
593
|
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
596
594
|
}
|
|
597
|
-
.celestia-scroll-container {
|
|
598
|
-
scrollbar-width: thin;
|
|
599
|
-
scrollbar-color: var(--sl-color-gray-5) transparent;
|
|
600
|
-
}
|
|
601
595
|
.group-hover\:-translate-x-1 {
|
|
602
596
|
&:is(:where(.group):hover *) {
|
|
603
597
|
@media (hover: hover) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "starlight-theme-celestia",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.4",
|
|
5
5
|
"description": "A clean, modern theme for Astro Starlight",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
],
|
|
23
23
|
"scripts": {
|
|
24
24
|
"build": "bun run build:tailwindcss",
|
|
25
|
-
"build:tailwindcss": "tailwindcss -i ./lib/tailwind.build.css -o ./lib/tailwind.gen.css"
|
|
25
|
+
"build:tailwindcss": "tailwindcss -i ./lib/tailwind.build.css -o ./lib/tailwind.gen.css",
|
|
26
|
+
"test": "bun test"
|
|
26
27
|
},
|
|
27
28
|
"dependencies": {
|
|
28
29
|
"@aria-ui/core": "^0.2.0",
|
|
@@ -38,7 +39,7 @@
|
|
|
38
39
|
"rehype": "^13.0.2",
|
|
39
40
|
"remark-custom-header-id": "^1.0.0",
|
|
40
41
|
"shiki-twoslash-renderer": "^0.3.3",
|
|
41
|
-
"starlight-versions": "^0.
|
|
42
|
+
"starlight-versions": "^0.9.0"
|
|
42
43
|
},
|
|
43
44
|
"peerDependencies": {
|
|
44
45
|
"@astrojs/starlight": "*"
|
|
@@ -49,7 +50,7 @@
|
|
|
49
50
|
}
|
|
50
51
|
},
|
|
51
52
|
"devDependencies": {
|
|
52
|
-
"@astrojs/starlight": "^0.
|
|
53
|
+
"@astrojs/starlight": "^0.39.0",
|
|
53
54
|
"@tailwindcss/cli": "^4.2.2",
|
|
54
55
|
"@tailwindcss/vite": "^4.2.2",
|
|
55
56
|
"@types/node": "^25.0.0",
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { expect, test } from "bun:test";
|
|
2
|
+
|
|
3
|
+
import starlightCelestiaTheme from "./index";
|
|
4
|
+
|
|
5
|
+
test("default factory returns a valid Starlight plugin", () => {
|
|
6
|
+
const plugin = starlightCelestiaTheme();
|
|
7
|
+
|
|
8
|
+
expect(plugin.name).toBe("starlight-theme-celestia");
|
|
9
|
+
expect(plugin.hooks).toHaveProperty("config:setup");
|
|
10
|
+
expect(typeof plugin.hooks["config:setup"]).toBe("function");
|
|
11
|
+
});
|
package/src/index.ts
CHANGED
|
@@ -31,7 +31,7 @@ export default function starlightCelestiaTheme(options: ThemeCelestiaOptions = {
|
|
|
31
31
|
return {
|
|
32
32
|
name: "starlight-theme-celestia",
|
|
33
33
|
hooks: {
|
|
34
|
-
setup: async ({ config, updateConfig, addIntegration, astroConfig }) => {
|
|
34
|
+
"config:setup": async ({ config, updateConfig, addIntegration, astroConfig }) => {
|
|
35
35
|
let useTailwind: boolean;
|
|
36
36
|
|
|
37
37
|
if (options.stylingSystem === "css") {
|
|
@@ -18,6 +18,31 @@ export function transformerContainer(): ShikiTransformer {
|
|
|
18
18
|
throw new Error(`[${name}] Expected at least one child`);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
// Mermaid blocks must reach downstream rehype plugins (e.g. rehype-mermaid)
|
|
22
|
+
// unwrapped. Shiki rewrites the original `<pre><code class="language-mermaid">`
|
|
23
|
+
// into highlighted tokens with `data-language="mermaid"`, which strips the
|
|
24
|
+
// class rehype-mermaid keys off. Restore the pre-shiki structure so any
|
|
25
|
+
// mermaid strategy (pre-mermaid, inline-svg, img-svg, img-png) can pick it
|
|
26
|
+
// up. If no mermaid plugin is configured the block falls back to plain code.
|
|
27
|
+
if (this.options.lang === "mermaid") {
|
|
28
|
+
node.children = [
|
|
29
|
+
{
|
|
30
|
+
type: "element",
|
|
31
|
+
tagName: "pre",
|
|
32
|
+
properties: {},
|
|
33
|
+
children: [
|
|
34
|
+
{
|
|
35
|
+
type: "element",
|
|
36
|
+
tagName: "code",
|
|
37
|
+
properties: { className: ["language-mermaid"] },
|
|
38
|
+
children: [{ type: "text", value: this.source }],
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
return node;
|
|
44
|
+
}
|
|
45
|
+
|
|
21
46
|
const pre = node.children.find((child) => isElement(child, "pre"));
|
|
22
47
|
|
|
23
48
|
if (!pre) {
|