Skip to content

Commit 9c5ee6f

Browse files
authored
🔨 Update typedoc config and styles (schteppe#121)
1 parent f5a794c commit 9c5ee6f

File tree

4 files changed

+33
-65
lines changed

4 files changed

+33
-65
lines changed

docs-style.css

+30-33
Original file line numberDiff line numberDiff line change
@@ -3,57 +3,54 @@ body {
33
Segoe UI Emoji !important;
44
}
55

6+
/* Disable header disappearing */
67
.tsd-page-toolbar {
78
transform: none !important;
89
}
9-
10-
.tsd-navigation {
11-
top: 40px !important;
10+
.tsd-navigation.secondary {
11+
top: calc(40px) !important;
1212
max-height: calc(100vh - 40px) !important;
13-
padding-top: 2rem !important;
1413
}
1514

16-
.tsd-navigation > ul > li:first-child {
17-
margin-top: 0 !important;
15+
/* Adjust spacings */
16+
.tsd-navigation.primary {
17+
padding-bottom: 0 !important;
18+
}
19+
.tsd-navigation.secondary > ul > li.tsd-kind-class:first-child:not(.current) {
20+
margin-top: 20px;
1821
}
1922

23+
/* Hide unnecessary filter */
2024
#tsd-filter-visibility {
2125
display: none !important;
2226
}
2327

24-
#tsd-filter-only-exported,
25-
[for='tsd-filter-only-exported'] {
26-
display: none !important;
28+
/* Hide "Class" text */
29+
.tsd-page-title .tsd-breadcrumb + h1 {
30+
overflow: hidden;
31+
text-indent: -90px;
2732
}
2833

34+
/* Easier to read line-height */
2935
.tsd-typography p {
3036
line-height: 1.7;
3137
}
3238

33-
.tsd-typography p a {
34-
color: #0366d6;
35-
}
36-
37-
pre {
38-
background: #f6f8fa !important;
39-
}
39+
/* GitHub styles for <pre> blocks */
40+
:root {
41+
--light-hl-0: #d73a49; /* declarations */
42+
--light-hl-1: #000000;
43+
--light-hl-2: #0070c1;
44+
--light-hl-3: #6442c1; /* names */
45+
--light-hl-4: #24292e; /* variable names */
46+
--light-hl-5: #098658;
47+
--light-hl-6: #6a737d; /* comments */
48+
--light-hl-7: #af00db;
49+
--light-hl-8: #267f99;
50+
--light-hl-9: #a31515;
51+
--light-hl-10: #000000ff;
4052

41-
/* comments */
42-
pre span[style='color: #008000'] {
43-
color: #6a737d !important;
44-
}
45-
46-
/* names */
47-
pre span[style='color: #795E26'] {
48-
color: #6442c1 !important;
49-
}
50-
51-
/* declarations */
52-
pre span[style='color: #0000FF'] {
53-
color: #d73a49 !important;
54-
}
53+
--light-code-background: #f6f8fa;
5554

56-
/* variable names */
57-
pre span[style='color: #001080'] {
58-
color: #24292e !important;
55+
--light-color-link: #0366d6;
5956
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"prepublishOnly": "npm run build && npm run test",
2929
"typecheck": "tsc --noEmit --emitDeclarationOnly false --strict",
3030
"typegen": "tsc --outFile dist/cannon-es.d.ts",
31-
"generate-docs": "typedoc && node ./scripts/inject-css-in-docs.mjs",
31+
"generate-docs": "typedoc",
3232
"test": "jest",
3333
"eslint": "eslint .",
3434
"eslint-fix": "eslint --fix .",

scripts/inject-css-in-docs.mjs

-30
This file was deleted.

typedoc.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"entryPoints": "./src/cannon-es.ts",
33
"out": "docs/",
44
"readme": "./getting-started.md",
5-
"theme": "minimal",
5+
"customCss": "./docs-style.css",
6+
"cleanOutputDir": true,
67
"excludePrivate": true,
78
"excludeProtected": true,
89
"excludeExternals": true,

0 commit comments

Comments
 (0)