-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
37ae93c
commit 7c0463c
Showing
12 changed files
with
4,279 additions
and
3,514 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
import { useEffect } from "react"; | ||
import { useColorMode } from "@chakra-ui/react"; // 假设你使用的是 @chakra-ui/react 来处理 colorMode | ||
|
||
import "highlight.js/styles/github-dark.css"; // 导入 GitHub Dark 主题的 CSS 文件 | ||
const LoadMarkdownCSSStyle = () => { | ||
const { colorMode } = useColorMode(); | ||
|
||
useEffect(() => { | ||
const loadCSS = async () => { | ||
if (colorMode === "dark") { | ||
await import("highlight.js/styles/github-dark.css"); | ||
} else { | ||
await import("highlight.js/styles/github.css"); | ||
} | ||
}; | ||
// useEffect(() => { | ||
// const loadCSS = async () => { | ||
// if (colorMode === "dark") { | ||
// await import ("highlight.js/styles/github-dark.css"); | ||
// } else { | ||
// await import("highlight.js/styles/github.css"); | ||
// } | ||
// }; | ||
|
||
loadCSS(); | ||
}, [colorMode]); | ||
// loadCSS(); | ||
// }, [colorMode]); | ||
|
||
return null; | ||
// return null; | ||
}; | ||
|
||
export default LoadMarkdownCSSStyle; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters