diff --git a/web/src/less/code-highlight.less b/web/src/less/code-highlight.less new file mode 100644 index 00000000..6d95345b --- /dev/null +++ b/web/src/less/code-highlight.less @@ -0,0 +1,7 @@ +html.dark { + @import (less) "highlight.js/styles/atom-one-dark.css"; +} + +html:not(.dark) { + @import (less) "highlight.js/styles/github.css"; +} diff --git a/web/src/main.tsx b/web/src/main.tsx index 4afd9d48..4aa1b065 100644 --- a/web/src/main.tsx +++ b/web/src/main.tsx @@ -11,7 +11,7 @@ import "dayjs/locale/zh"; import "dayjs/locale/fr"; import "dayjs/locale/vi"; import theme from "./theme"; -import "highlight.js/styles/github.css"; +import "./less/code-highlight.less"; import "./css/global.css"; import "./css/tailwind.css";