Skip to content

Commit c77fe58

Browse files
committed
💄Fix light mode code highlight
1 parent 84973bd commit c77fe58

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

website/index.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,17 @@
33
<head>
44
<meta charset="UTF-8" />
55
<link rel="icon" type="image/svg+xml" href="/react-dot-cursor.svg" />
6+
<!-- highlight.js github-dark style: https://github.com/highlightjs/highlight.js/blob/main/src/styles/github-dark.css -->
67
<link
78
rel="stylesheet"
89
href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css"
10+
media="(prefers-color-scheme: dark)"
11+
/>
12+
<!-- highlight.js github style: https://github.com/highlightjs/highlight.js/blob/main/src/styles/github.css -->
13+
<link
14+
rel="stylesheet"
15+
href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github.min.css"
16+
media="(prefers-color-scheme: light)"
917
/>
1018
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
1119

website/tailwind.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export default {
5454
typography: (theme) => ({
5555
DEFAULT: {
5656
css: {
57+
color: theme('colors.foreground'),
5758
'code::before': {
5859
content: '""',
5960
},
@@ -71,6 +72,16 @@ export default {
7172
fontStyle: 'normal',
7273
color: theme('colors.muted.foreground'),
7374
},
75+
pre: {
76+
color: theme('colors.foreground'),
77+
background: theme('colors.muted.DEFAULT'),
78+
},
79+
'ul > li::marker': {
80+
color: theme('colors.foreground'),
81+
},
82+
'ol > li::marker': {
83+
color: theme('colors.foreground'),
84+
},
7485
},
7586
},
7687
}),

0 commit comments

Comments
 (0)