Skip to content

Commit 9db174a

Browse files
committed
エディターと通常シンタックスハイライトの色をテーマに合わせて上書き
1 parent 935bc2a commit 9db174a

File tree

4 files changed

+21
-4
lines changed

4 files changed

+21
-4
lines changed

app/[docs_id]/markdown.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ function CodeComponent({
152152
<SyntaxHighlighter
153153
language={match[1]}
154154
PreTag="div"
155-
className="border border-current/20 mx-2 my-2 rounded-box p-4!"
155+
className="border-2 border-current/20 mx-2 my-2 rounded-box p-4! bg-base-300! text-base-content!"
156156
style={codetheme}
157157
{...props}
158158
>
@@ -164,7 +164,7 @@ function CodeComponent({
164164
return (
165165
<SyntaxHighlighter
166166
PreTag="div"
167-
className="border border-current/20 mx-2 my-2 rounded-box p-4!"
167+
className="border-2 border-current/20 mx-2 my-2 rounded-box p-4! bg-base-300! text-base-content!"
168168
style={codetheme}
169169
{...props}
170170
>

app/globals.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,23 @@ mycdark:
8888

8989
@custom-variant dark (&:where([data-theme=mycdark], [data-theme=mycdark] *));
9090

91+
/* Aceの背景色と文字色を上書き */
92+
.ace_editor {
93+
background-color: var(--color-base-300) !important;
94+
color: var(--color-base-content) !important;
95+
}
96+
.ace_gutter {
97+
background: inherit !important;
98+
color: inherit !important;
99+
}
100+
.ace_active-line {
101+
background: var(--color-base-content) !important;
102+
opacity: 0.1;
103+
}
104+
.ace_gutter-active-line {
105+
background-color: color-mix(in oklch, var(--color-base-content) 20%, var(--color-base-300)) !important;
106+
}
107+
91108
/* CDNからダウンロードするURLを指定したらなんかエラー出るので、npmでインストールしてlayout.tsxでimportすることにした */
92109
@theme {
93110
/*

app/terminal/editor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export function EditorComponent(props: EditorProps) {
9797

9898
return (
9999
<div className="border border-accent border-2 shadow-md m-2 rounded-box overflow-hidden">
100-
<div className="flex flex-row items-center">
100+
<div className="flex flex-row items-center bg-base-200">
101101
<div className="font-mono text-sm mt-2 mb-1 ml-4 mr-2">
102102
{props.filename}
103103
{props.readonly && <span className="font-sans ml-2">(編集不可)</span>}

app/terminal/exec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export function ExecFile(props: ExecProps) {
7373

7474
return (
7575
<div className="border border-accent border-2 shadow-md m-2 rounded-box overflow-hidden relative">
76-
<div>
76+
<div className="bg-base-200">
7777
<button
7878
className="btn btn-soft btn-accent rounded-none"
7979
onClick={() => {

0 commit comments

Comments
 (0)