Skip to content

Commit 0bbbfee

Browse files
Merge pull request #442 from jonathanhefner/typedoc-theme-css-patch
Apply `typedoc-github-theme` typography fixes locally via `customCss`
2 parents a4fda18 + faabb6d commit 0bbbfee

2 files changed

Lines changed: 120 additions & 0 deletions

File tree

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
/**
2+
* Local overrides for typedoc-github-theme typography styles.
3+
*
4+
* Upstream PR: https://github.com/JulianWowra/typedoc-github-theme/pull/7
5+
*
6+
* Remove this file once the PR is merged and the theme dependency is updated.
7+
*/
8+
9+
/*
10+
* Typography (all markdown content)
11+
*/
12+
13+
.tsd-typography {
14+
line-height: 1.5;
15+
}
16+
17+
/* Underline plain links; TypeDoc adds classes to code refs and anchor icons */
18+
.tsd-typography a:not([class]),
19+
.tsd-typography a.external {
20+
text-decoration: underline;
21+
}
22+
23+
.tsd-typography code {
24+
margin: 0;
25+
}
26+
27+
.tsd-typography ul {
28+
list-style: disc;
29+
}
30+
31+
.tsd-typography ul ul {
32+
list-style: circle;
33+
}
34+
35+
.tsd-typography ul ul ul {
36+
list-style: square;
37+
}
38+
39+
.tsd-typography ul,
40+
.tsd-typography ol {
41+
padding-left: 32px;
42+
}
43+
44+
.tsd-typography pre {
45+
padding: 16px;
46+
overflow: auto;
47+
}
48+
49+
.tsd-typography strong {
50+
font-weight: 600;
51+
}
52+
53+
/*
54+
* Typography headings (document pages only)
55+
*
56+
* Heading styles are scoped to .tsd-panel.tsd-typography to avoid affecting
57+
* JSDoc comment prose (.tsd-comment.tsd-typography) on API pages.
58+
*/
59+
60+
/* Override heading margin for the first element (matches GitHub's markdown-body) */
61+
.tsd-panel.tsd-typography > :first-child {
62+
margin-top: 0 !important;
63+
}
64+
65+
.tsd-panel.tsd-typography h1,
66+
.tsd-panel.tsd-typography h2,
67+
.tsd-panel.tsd-typography h3,
68+
.tsd-panel.tsd-typography h4,
69+
.tsd-panel.tsd-typography h5,
70+
.tsd-panel.tsd-typography h6 {
71+
margin-top: 24px;
72+
margin-bottom: 16px;
73+
font-weight: 600;
74+
line-height: 1.25;
75+
}
76+
77+
.tsd-panel.tsd-typography h1 {
78+
font-size: 2em;
79+
padding-bottom: 0.3em;
80+
border-bottom: 1px solid var(--color-accent);
81+
}
82+
83+
.tsd-panel.tsd-typography h2 {
84+
font-size: 1.5em;
85+
padding-bottom: 0.3em;
86+
border-bottom: 1px solid var(--color-accent);
87+
}
88+
89+
.tsd-panel.tsd-typography h3 {
90+
font-size: 1.25em;
91+
}
92+
93+
.tsd-panel.tsd-typography h4 {
94+
font-size: 1em;
95+
}
96+
97+
.tsd-panel.tsd-typography h5 {
98+
font-size: 0.875em;
99+
}
100+
101+
.tsd-panel.tsd-typography h6 {
102+
font-size: 0.85em;
103+
color: var(--color-text-aside);
104+
}
105+
106+
.tsd-panel.tsd-typography > h1,
107+
.tsd-panel.tsd-typography > h2,
108+
.tsd-panel.tsd-typography > h3 {
109+
margin-left: 0;
110+
margin-right: 0;
111+
padding: 0;
112+
}
113+
114+
.tsd-panel.tsd-typography > h1,
115+
.tsd-panel.tsd-typography > h2 {
116+
padding-bottom: 0.3em;
117+
}

typedoc.config.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ const config = {
4646
"./scripts/typedoc-plugin-fix-mermaid-entities.mjs",
4747
"@boneskull/typedoc-plugin-mermaid",
4848
],
49+
// Remove once typedoc-github-theme merges upstream fix:
50+
// https://github.com/JulianWowra/typedoc-github-theme/pull/7
51+
customCss: "./scripts/typedoc-github-theme-fixes.css",
4952
ignoredHighlightLanguages: ["mermaid"],
5053
};
5154

0 commit comments

Comments
 (0)