varvara-typedoc-theme 0.1.3 → 0.2.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.
- package/README.md +48 -1
- package/assets/overrides.css +29 -21
- package/dist/index.js +9 -14
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ _View a_ [_live example here_](https://marcmarine.github.io/western-signs).
|
|
|
4
4
|
|
|
5
5
|
Varvara TypeDoc Theme is a custom theme for TypeDoc, designed to provide a seamless documentation experience for TypeScript projects.
|
|
6
6
|
|
|
7
|
-

|
|
7
|
+
[](https://www.npmjs.com/package/varvara-typedoc-theme)
|
|
8
8
|
[](https://github.com/marcmarine/varvara-js/blob/main/LICENSE)
|
|
9
9
|
|
|
10
10
|
## Installation
|
|
@@ -56,6 +56,53 @@ export default config
|
|
|
56
56
|
> [!IMPORTANT]
|
|
57
57
|
> The theme must be explicitly specified. If not set, the plugin will not be loaded by default.
|
|
58
58
|
|
|
59
|
+
### Customization
|
|
60
|
+
|
|
61
|
+
Add custom styling by specifying an extra CSS file using the [customCss](https://typedoc.org/documents/Options.Output.html#customcss) option:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npx typedoc --customCss ./styles/custom.css
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Varvara CSS provides variables to customize the theme appearance:
|
|
68
|
+
|
|
69
|
+
```css
|
|
70
|
+
/* custom.css */
|
|
71
|
+
|
|
72
|
+
@media (prefers-color-scheme: light) {
|
|
73
|
+
:root {
|
|
74
|
+
--va-color-foreground: DimGray;
|
|
75
|
+
--va-color-background: WhiteSmoke;
|
|
76
|
+
--va-border-color: Gainsboro;
|
|
77
|
+
--va-space-ratio: 0.5;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
@media (prefers-color-scheme: dark) {
|
|
81
|
+
:root {
|
|
82
|
+
--va-color-foreground: Silver;
|
|
83
|
+
--va-color-background: MidnightBlue;
|
|
84
|
+
--va-border-color: RoyalBlue;
|
|
85
|
+
--va-space-ratio: 0.5;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
[data-theme='light'] {
|
|
90
|
+
--va-color-foreground: DimGray;
|
|
91
|
+
--va-color-background: WhiteSmoke;
|
|
92
|
+
--va-border-color: Gainsboro;
|
|
93
|
+
--va-space-ratio: 0.5;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
[data-theme='dark'] {
|
|
97
|
+
--va-color-foreground: Silver;
|
|
98
|
+
--va-color-background: MidnightBlue;
|
|
99
|
+
--va-border-color: RoyalBlue;
|
|
100
|
+
--va-space-ratio: 0.5;
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
See the [documentation](https://varvara.js.org/variables) for the complete list of available properties.
|
|
105
|
+
|
|
59
106
|
## Contributing
|
|
60
107
|
|
|
61
108
|
Feel free to explore, test, and provide feedback. Your contribution is highly appreciated as we work towards improving and stabilizing the project.
|
package/assets/overrides.css
CHANGED
|
@@ -1,22 +1,9 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
--va-collapse-tree-indentation: var(--va-space-4);
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
html[data-theme='light'] {
|
|
6
|
-
--va-color-foreground: #29353d;
|
|
7
|
-
--va-color-background: #f3f5f7;
|
|
8
|
-
--va-border-color: lightgray;
|
|
9
|
-
}
|
|
10
|
-
html[data-theme='dark'] {
|
|
11
|
-
--va-color-foreground: #b3ccd6;
|
|
12
|
-
--va-color-background: #2a303c;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
1
|
@media (prefers-color-scheme: light) {
|
|
16
2
|
:root {
|
|
17
3
|
--va-color-foreground: #29353d;
|
|
18
4
|
--va-color-background: #f3f5f7;
|
|
19
|
-
--va-border-color:
|
|
5
|
+
--va-border-color: LightGray;
|
|
6
|
+
--va-color-primary: RoyalBlue;
|
|
20
7
|
}
|
|
21
8
|
}
|
|
22
9
|
|
|
@@ -24,14 +11,34 @@ html[data-theme='dark'] {
|
|
|
24
11
|
:root {
|
|
25
12
|
--va-color-foreground: #b3ccd6;
|
|
26
13
|
--va-color-background: #2a303c;
|
|
14
|
+
--va-border-color: LightSlateGray;
|
|
15
|
+
--va-color-primary: LightSkyBlue;
|
|
27
16
|
}
|
|
28
17
|
}
|
|
29
18
|
|
|
19
|
+
[data-theme='light'] {
|
|
20
|
+
--va-color-foreground: #29353d;
|
|
21
|
+
--va-color-background: #f3f5f7;
|
|
22
|
+
--va-border-color: LightGray;
|
|
23
|
+
--va-color-primary: RoyalBlue;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
[data-theme='dark'] {
|
|
27
|
+
--va-color-foreground: #b3ccd6;
|
|
28
|
+
--va-color-background: #2a303c;
|
|
29
|
+
--va-border-color: LightSlateGray;
|
|
30
|
+
--va-color-primary: LightSkyBlue;
|
|
31
|
+
}
|
|
32
|
+
|
|
30
33
|
body {
|
|
31
34
|
background-color: var(--va-color-background);
|
|
32
35
|
color: var(--va-color-foreground);
|
|
33
36
|
}
|
|
34
37
|
|
|
38
|
+
a {
|
|
39
|
+
color: var(--va-color-primary);
|
|
40
|
+
}
|
|
41
|
+
|
|
35
42
|
.va-button:has(.version-badge) {
|
|
36
43
|
position: relative;
|
|
37
44
|
}
|
|
@@ -125,12 +132,12 @@ body {
|
|
|
125
132
|
|
|
126
133
|
.settings .va-select {
|
|
127
134
|
width: 100%;
|
|
128
|
-
border-left:
|
|
135
|
+
border-left-color: transparent;
|
|
129
136
|
border-right: 0;
|
|
130
137
|
border-bottom: 0;
|
|
131
138
|
}
|
|
132
139
|
|
|
133
|
-
.settings .va-select
|
|
140
|
+
.settings label:has(.va-select) {
|
|
134
141
|
padding-left: 0 !important;
|
|
135
142
|
}
|
|
136
143
|
|
|
@@ -162,7 +169,7 @@ footer {
|
|
|
162
169
|
}
|
|
163
170
|
|
|
164
171
|
.container {
|
|
165
|
-
padding: 0
|
|
172
|
+
padding: 0 var(--va-space-8);
|
|
166
173
|
}
|
|
167
174
|
|
|
168
175
|
@media (max-width: 769px) {
|
|
@@ -187,9 +194,10 @@ footer {
|
|
|
187
194
|
.container-main {
|
|
188
195
|
grid-template-areas: 'header content' 'sidebar content';
|
|
189
196
|
grid-auto-rows: auto 1fr;
|
|
197
|
+
margin: var(--va-space-8) auto;
|
|
190
198
|
}
|
|
191
199
|
.container {
|
|
192
|
-
padding: 0
|
|
200
|
+
padding: 0 var(--va-space-8);
|
|
193
201
|
}
|
|
194
202
|
}
|
|
195
203
|
|
|
@@ -202,8 +210,8 @@ footer {
|
|
|
202
210
|
}
|
|
203
211
|
.page-menu,
|
|
204
212
|
.site-menu {
|
|
205
|
-
top:
|
|
206
|
-
max-height: calc(100vh -
|
|
213
|
+
top: var(--va-space-8);
|
|
214
|
+
max-height: calc(100vh - calc(var(--va-space-8) * 2));
|
|
207
215
|
}
|
|
208
216
|
}
|
|
209
217
|
|
package/dist/index.js
CHANGED
|
@@ -90,10 +90,7 @@ function sidebar(context) {
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
// src/partials/navigation.tsx
|
|
93
|
-
import {
|
|
94
|
-
JSX as JSX3,
|
|
95
|
-
ReflectionFlag
|
|
96
|
-
} from "typedoc";
|
|
93
|
+
import { JSX as JSX3, ReflectionFlag } from "typedoc";
|
|
97
94
|
function pageSidebar(context) {
|
|
98
95
|
return (props) => {
|
|
99
96
|
return /* @__PURE__ */ JSX3.createElement("div", {
|
|
@@ -128,9 +125,7 @@ function settings(context) {
|
|
|
128
125
|
class: "settings-label"
|
|
129
126
|
}, context.i18n.theme_member_visibility()), /* @__PURE__ */ JSX3.createElement("ul", {
|
|
130
127
|
id: "tsd-filter-options"
|
|
131
|
-
}, ...visibilityOptions)), /* @__PURE__ */ JSX3.createElement("
|
|
132
|
-
class: "va-select-group"
|
|
133
|
-
}, /* @__PURE__ */ JSX3.createElement("label", null, context.i18n.theme_theme()), /* @__PURE__ */ JSX3.createElement("select", {
|
|
128
|
+
}, ...visibilityOptions)), /* @__PURE__ */ JSX3.createElement("label", null, /* @__PURE__ */ JSX3.createElement("span", null, context.i18n.theme_theme()), /* @__PURE__ */ JSX3.createElement("select", {
|
|
134
129
|
id: "tsd-theme",
|
|
135
130
|
class: "va-select"
|
|
136
131
|
}, /* @__PURE__ */ JSX3.createElement("option", {
|
|
@@ -342,15 +337,9 @@ function layout(context) {
|
|
|
342
337
|
}), /* @__PURE__ */ JSX5.createElement("link", {
|
|
343
338
|
rel: "stylesheet",
|
|
344
339
|
href: context.relativeURL("assets/highlight.css", true)
|
|
345
|
-
}), context.options.getValue("customCss") && /* @__PURE__ */ JSX5.createElement("link", {
|
|
346
|
-
rel: "stylesheet",
|
|
347
|
-
href: context.relativeURL("assets/custom.css", true)
|
|
348
340
|
}), /* @__PURE__ */ JSX5.createElement("script", {
|
|
349
341
|
defer: true,
|
|
350
342
|
src: context.relativeURL("assets/main.js", true)
|
|
351
|
-
}), context.options.getValue("customJs") && /* @__PURE__ */ JSX5.createElement("script", {
|
|
352
|
-
defer: true,
|
|
353
|
-
src: context.relativeURL("assets/custom.js", true)
|
|
354
343
|
}), /* @__PURE__ */ JSX5.createElement("script", {
|
|
355
344
|
async: true,
|
|
356
345
|
src: context.relativeURL("assets/icons.js", true),
|
|
@@ -367,7 +356,13 @@ function layout(context) {
|
|
|
367
356
|
async: true,
|
|
368
357
|
src: context.relativeURL("assets/hierarchy.js", true),
|
|
369
358
|
id: "tsd-hierarchy-script"
|
|
370
|
-
}), context.hook("head.end", context)
|
|
359
|
+
}), context.hook("head.end", context), context.options.getValue("customCss") && /* @__PURE__ */ JSX5.createElement("link", {
|
|
360
|
+
rel: "stylesheet",
|
|
361
|
+
href: context.relativeURL("assets/custom.css", true)
|
|
362
|
+
}), context.options.getValue("customJs") && /* @__PURE__ */ JSX5.createElement("script", {
|
|
363
|
+
defer: true,
|
|
364
|
+
src: context.relativeURL("assets/custom.js", true)
|
|
365
|
+
})), /* @__PURE__ */ JSX5.createElement("body", null, context.hook("body.begin", context), /* @__PURE__ */ JSX5.createElement("script", null, /* @__PURE__ */ JSX5.createElement(JSX5.Raw, {
|
|
371
366
|
html: 'document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";'
|
|
372
367
|
})), /* @__PURE__ */ JSX5.createElement("div", {
|
|
373
368
|
class: "container container-main"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "varvara-typedoc-theme",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"author": "Marc Mariné <shenobi@gmail.com>",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
"directory": "packages/typedoc-theme"
|
|
9
9
|
},
|
|
10
10
|
"type": "module",
|
|
11
|
-
"description": "
|
|
11
|
+
"description": "Varvara theme for TypeDoc.",
|
|
12
12
|
"keywords": [
|
|
13
13
|
"typedoc-theme",
|
|
14
14
|
"varvara-css"
|
|
15
15
|
],
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"varvara-css": "
|
|
18
|
+
"varvara-css": "latest"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@types/bun": "latest"
|