Skip to content

Commit a9af817

Browse files
committed
テーマチェンジ機能の追加
1 parent 2495be3 commit a9af817

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

app/[docs_id]/markdown.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,19 @@ import { PythonEmbeddedTerminal } from "../terminal/python/embedded";
55
import { Heading } from "./section";
66
import { type AceLang, EditorComponent } from "../terminal/editor";
77
import { ExecFile, ExecLang } from "../terminal/exec";
8+
import { ChangeTheme } from "./themeToggle";
89
import { tomorrow } from "react-syntax-highlighter/dist/esm/styles/hljs";
10+
import { twilight } from "react-syntax-highlighter/dist/esm/styles/prism";
911

1012
export function StyledMarkdown({ content }: { content: string }) {
11-
const syntaxtheme = ChangeTheme() === "twilight" ? vscDarkPlus : prism;
13+
const syntaxtheme = ChangeTheme() === "twilight" ? tomorrow : twilight;
14+
return (
15+
<Markdown remarkPlugins={[remarkGfm]} components={components}>
16+
{content}
17+
</Markdown>
18+
);
19+
}
20+
1221

1322
// TailwindCSSがh1などのタグのスタイルを消してしまうので、手動でスタイルを指定する必要がある
1423
const components: Components = {

app/terminal/editor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export function EditorComponent(props: EditorProps) {
8787
<AceEditor
8888
name={`ace-editor-${props.filename}`}
8989
mode={props.language}
90-
theme="tomorrow" // TODO dark theme (twilightがいいんじゃないかと勝手に思っている)
90+
theme={ChangeTheme()}
9191
tabSize={props.tabSize}
9292
width="100%"
9393
height={

0 commit comments

Comments
 (0)