Skip to content

Commit aaca3ff

Browse files
committed
Centralize our github-centered color scheme into github-common.
1 parent 883e425 commit aaca3ff

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

src/lib/enhancers/github/github-common.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,27 @@ export const commonGitHubOptions: Options = {
1111

1212
export function prepareGitHubHighlighter() {
1313
oncePerRefresh("github-highlighter", () => {
14+
const textColor = "rgb(31, 35, 40)"
15+
const headingColor = "rgb(174, 52, 151)"
16+
OverType.setTheme({
17+
colors: {
18+
blockquote: "rgb(89, 99, 110)",
19+
code: "#59636e",
20+
codeBg: "#f6f8fa",
21+
cursor: "#000000",
22+
em: "rgb(126, 123, 255)",
23+
h1: headingColor,
24+
h2: headingColor,
25+
h3: headingColor,
26+
hr: "#5a7a9b",
27+
link: "rgb(9, 105, 218)",
28+
selection: "rgba(0, 123, 255, 0.3)",
29+
strong: "rgb(45, 1, 142)",
30+
syntaxMarker: textColor,
31+
text: textColor,
32+
},
33+
name: "custom-github",
34+
})
1435
OverType.setCodeHighlighter(githubHighlighter)
1536
})
1637
}

src/lib/registries.ts

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,6 @@ export class EnhancerRegistry {
3232
this.register(new GitHubIssueCreateEnhancer())
3333
this.register(new GitHubPrAppendEnhancer())
3434
this.register(new GitHubPrCreateEnhancer())
35-
const textColor = "rgb(31, 35, 40)"
36-
const headingColor = "rgb(174, 52, 151)"
37-
OverType.setTheme({
38-
colors: {
39-
blockquote: "rgb(89, 99, 110)",
40-
code: "#59636e",
41-
codeBg: "#f6f8fa",
42-
cursor: "#000000",
43-
em: "rgb(126, 123, 255)",
44-
h1: headingColor,
45-
h2: headingColor,
46-
h3: headingColor,
47-
hr: "#5a7a9b",
48-
link: "rgb(9, 105, 218)",
49-
selection: "rgba(0, 123, 255, 0.3)",
50-
strong: "rgb(45, 1, 142)",
51-
syntaxMarker: textColor,
52-
text: textColor,
53-
},
54-
name: "custom-github",
55-
})
5635
}
5736

5837
private register<T extends CommentSpot>(enhancer: CommentEnhancer<T>): void {

0 commit comments

Comments
 (0)