varvara-typedoc-theme 0.1.3 → 0.2.0

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 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
- ![NPM Version](https://img.shields.io/npm/v/varvara-typedoc-theme)
7
+ [![NPM Version](https://img.shields.io/npm/v/varvara-typedoc-theme)](https://www.npmjs.com/package/varvara-typedoc-theme)
8
8
  [![GitHub License](https://img.shields.io/github/license/marcmarine/varvara-js)](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.
@@ -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: lightgray;
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
  }
@@ -162,7 +169,7 @@ footer {
162
169
  }
163
170
 
164
171
  .container {
165
- padding: 0 1.5rem;
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) 0;
190
198
  }
191
199
  .container {
192
- padding: 0 2rem;
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: 2rem;
206
- max-height: calc(100vh - 4rem);
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
@@ -342,15 +342,9 @@ function layout(context) {
342
342
  }), /* @__PURE__ */ JSX5.createElement("link", {
343
343
  rel: "stylesheet",
344
344
  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
345
  }), /* @__PURE__ */ JSX5.createElement("script", {
349
346
  defer: true,
350
347
  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
348
  }), /* @__PURE__ */ JSX5.createElement("script", {
355
349
  async: true,
356
350
  src: context.relativeURL("assets/icons.js", true),
@@ -367,7 +361,13 @@ function layout(context) {
367
361
  async: true,
368
362
  src: context.relativeURL("assets/hierarchy.js", true),
369
363
  id: "tsd-hierarchy-script"
370
- }), context.hook("head.end", context)), /* @__PURE__ */ JSX5.createElement("body", null, context.hook("body.begin", context), /* @__PURE__ */ JSX5.createElement("script", null, /* @__PURE__ */ JSX5.createElement(JSX5.Raw, {
364
+ }), context.hook("head.end", context), context.options.getValue("customCss") && /* @__PURE__ */ JSX5.createElement("link", {
365
+ rel: "stylesheet",
366
+ href: context.relativeURL("assets/custom.css", true)
367
+ }), context.options.getValue("customJs") && /* @__PURE__ */ JSX5.createElement("script", {
368
+ defer: true,
369
+ src: context.relativeURL("assets/custom.js", true)
370
+ })), /* @__PURE__ */ JSX5.createElement("body", null, context.hook("body.begin", context), /* @__PURE__ */ JSX5.createElement("script", null, /* @__PURE__ */ JSX5.createElement(JSX5.Raw, {
371
371
  html: 'document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";'
372
372
  })), /* @__PURE__ */ JSX5.createElement("div", {
373
373
  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",
3
+ "version": "0.2.0",
4
4
  "author": "Marc Mariné <shenobi@gmail.com>",
5
5
  "repository": {
6
6
  "type": "git",