Skip to content

Commit 15ae0b4

Browse files
committed
テーマオプション設定
1 parent 8e369f9 commit 15ae0b4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

app/terminal/terminal.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,17 @@ export function TerminalComponent(props: TerminalComponentProps) {
4040
const term = new Terminal({
4141
cursorBlink: true,
4242
convertEol: true,
43+
cursorStyle: "bar",
44+
theme: {
45+
// DaisyUIの変数を使用してテーマを設定している
46+
// TODO: ダークテーマ/ライトテーマを切り替えたときに再設定する?
47+
// TODO: red, green, blueなどの色も設定する
48+
background: window.getComputedStyle(document.body).getPropertyValue("--color-base-300"),
49+
foreground: window.getComputedStyle(document.body).getPropertyValue("--color-base-content"),
50+
cursor: window.getComputedStyle(document.body).getPropertyValue("--color-base-content"),
51+
selectionBackground: window.getComputedStyle(document.body).getPropertyValue("--color-primary"),
52+
selectionForeground: window.getComputedStyle(document.body).getPropertyValue("--color-primary-content"),
53+
},
4354
});
4455
terminalInstanceRef.current = term;
4556
initDone.current = false;

0 commit comments

Comments
 (0)