mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
fix: dark mode of highlight.js
This commit is contained in:
@@ -30,11 +30,7 @@ const App = observer(() => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (darkMediaQuery.addEventListener) {
|
|
||||||
darkMediaQuery.addEventListener("change", handleColorSchemeChange);
|
darkMediaQuery.addEventListener("change", handleColorSchemeChange);
|
||||||
} else {
|
|
||||||
darkMediaQuery.addListener(handleColorSchemeChange);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("failed to initial color scheme listener", error);
|
console.error("failed to initial color scheme listener", error);
|
||||||
}
|
}
|
||||||
|
@@ -6,8 +6,6 @@ import toast from "react-hot-toast";
|
|||||||
import { cn } from "@/utils";
|
import { cn } from "@/utils";
|
||||||
import MermaidBlock from "./MermaidBlock";
|
import MermaidBlock from "./MermaidBlock";
|
||||||
import { BaseProps } from "./types";
|
import { BaseProps } from "./types";
|
||||||
import "highlight.js/styles/atom-one-dark.css";
|
|
||||||
import "highlight.js/styles/github.css";
|
|
||||||
|
|
||||||
// Special languages that are rendered differently.
|
// Special languages that are rendered differently.
|
||||||
enum SpecialLanguage {
|
enum SpecialLanguage {
|
||||||
|
@@ -522,9 +522,8 @@ const MemoEditor = observer((props: Props) => {
|
|||||||
<div className="w-full flex flex-row justify-between items-center py-3 gap-2 overflow-auto dark:border-t-zinc-500">
|
<div className="w-full flex flex-row justify-between items-center py-3 gap-2 overflow-auto dark:border-t-zinc-500">
|
||||||
<div className="relative flex flex-row justify-start items-center" onFocus={(e) => e.stopPropagation()}>
|
<div className="relative flex flex-row justify-start items-center" onFocus={(e) => e.stopPropagation()}>
|
||||||
<Select
|
<Select
|
||||||
className="!text-sm"
|
|
||||||
variant="plain"
|
variant="plain"
|
||||||
size="md"
|
size="sm"
|
||||||
value={state.memoVisibility}
|
value={state.memoVisibility}
|
||||||
startDecorator={<VisibilityIcon visibility={state.memoVisibility} />}
|
startDecorator={<VisibilityIcon visibility={state.memoVisibility} />}
|
||||||
onChange={(_, visibility) => {
|
onChange={(_, visibility) => {
|
||||||
|
@@ -1,3 +1,6 @@
|
|||||||
|
@import url("highlight.js/styles/github.css") (prefers-color-scheme: light);
|
||||||
|
@import url("highlight.js/styles/github-dark.css") (prefers-color-scheme: dark);
|
||||||
|
|
||||||
@tailwind base;
|
@tailwind base;
|
||||||
@tailwind components;
|
@tailwind components;
|
||||||
@tailwind utilities;
|
@tailwind utilities;
|
||||||
|
Reference in New Issue
Block a user