Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

fix: code highlight in dark mode (#702)

Stephen Zhoub7ab6f8e7ec1
diff --git a/web/src/less/code-highlight.less b/web/src/less/code-highlight.less
new file mode 100644
index 000000000..6d95345bc
--- /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 4afd9d485..4aa1b0650 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";