Skip to content

Commit 7e711db

Browse files
committed
[dev] use light code block for light theme, more contrast for dark theme
1 parent eb51f0e commit 7e711db

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

docusaurus.config.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,9 @@ const onAfterDataTransformation = (data) => {
161161
// @ts-check
162162
// Note: type annotations allow type checking and IDEs autocompletion
163163

164-
//const lightCodeTheme = require('prism-react-renderer/themes/github');
165-
//const darkCodeTheme = require('prism-react-renderer/themes/dracula');
164+
const { themes: prismThemes } = require('prism-react-renderer');
165+
const lightCodeTheme = prismThemes.github;
166+
const darkCodeTheme = prismThemes.vsDark;//vsDark
166167

167168
/** @type {import('@docusaurus/types').Config} */
168169
const config = {
@@ -356,8 +357,9 @@ const config = {
356357
]
357358
},
358359
prism: {
359-
//theme: lightCodeTheme,
360-
//darkTheme: darkCodeTheme,
360+
additionalLanguages: ['csharp', 'php'],
361+
theme: lightCodeTheme,
362+
darkTheme: darkCodeTheme,
361363
}
362364
})
363365
};

src/css/custom.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@
2525
--ifm-list-item-margin: 0.7rem;
2626
}
2727

28-
/* deprecated from v3.1
28+
2929
html[data-theme=dark] {
3030
--ifm-color-primary: #26adf7;
31+
--ifm-background-color: #111111;
3132
}
32-
33+
/* deprecated from v3.1
3334
.docusaurus-highlight-code-line {
3435
background-color: rgb(210, 213, 214);
3536
display: block;

0 commit comments

Comments
 (0)