-
Notifications
You must be signed in to change notification settings - Fork 1
テーマチェンジ機能の追加 #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
テーマチェンジ機能の追加 #30
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
my-code | 2c05b76 | Commit Preview URL Branch Preview URL |
Oct 03 2025, 07:26 AM |
ちょっと見づらいな?
具体的にどう色を変えたらいいかはパッとわからないけど、背景が明るすぎるのと、コードブロックの背景が黒すぎる+黒文字で読みづらいのがきになる
ちなみにテーマによって手動で色の指定を変更するのはこれの一番下にあるような書き方をするとできます |
a9af817 to
e1c7034
Compare
|
コンフリクトの解消はこれで大丈夫でしょうか? |
|
SyntaxHighlighterはmarkdown.tsx内に2カ所あるけど片方しか編集してないとか? |
|
ああ、はい pythonのターミナルはsyntaxhighlighterではないです useEffectの中で初期化時のテーマを設定しているんですけど、途中でテーマを変更する方法があるんじゃないかな? |
|
僕が物凄く勘違いをしていたようです。ご指摘ありがとうございました。 |
|
スマホ画面用のthemetoggleとの同期及びコード内の色の手動設定以外を実装しました。(これらの部分についてはこれから行います。) |
|
直近2つのコミットについて、
|
na-trium-144
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
色についてはあとで考え直すとして、一旦これだけ直したらそろそろマージしましょう
| "chat-bubble", | ||
| { "bg-primary text-primary-content": msg.sender === 'user' }, | ||
| { "bg-secondary-content text-black": msg.sender === 'ai' && !msg.isError }, | ||
| { "bg-secondary-content dark:bg-neutral text-black dark:text-white": msg.sender === 'ai' && !msg.isError }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
text-neutral-content か text-base-content (daisyuiの色) にしておけばlightモードでは黒、darkモードでは白になるんじゃないかな
(daisyuiのドキュメントの右上のボタンからテーマを変更するとテーマごとの色を確認できる)
ダークモードで文字を完全な白にするのはコントラストが強すぎるので普通は少しグレーにするのがいいらしいです(ダークモードユーザーじゃないのでしらんけど)
| import { ExecFile, ExecLang } from "../terminal/exec"; | ||
| import { tomorrow } from "react-syntax-highlighter/dist/esm/styles/hljs"; | ||
| import { useChangeTheme } from "./themeToggle"; | ||
| import { tomorrow, atomOneDark } from "react-syntax-highlighter/dist/esm/styles/hljs"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
twilightなかった?
まあ別にatomOneDarkでも良いんだけど
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prism系の方ならありました。hljsだと見当たらないような気がします。
| a: ({ node, ...props }) => <a className="link link-info" {...props} />, | ||
| strong: ({ node, ...props }) => ( | ||
| <strong className="text-primary" {...props} /> | ||
| <strong className="text-primary dark:text-secondary" {...props} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここに書くとaiの吹き出し以外でも色が変わってしまうのでは…
| ```python-exec:main.py | ||
| code: ({ node, className, ref, style, ...props }) => <CodeComponent {...{ node, className, ref, style, ...props }} />, | ||
| }; | ||
| function CodeComponent({ node, className, ref, style, ...props }: { node: unknown; className?: string; ref?: unknown; style?: unknown; [key: string]: unknown }) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
型指定が汚い 🤔 (別issueにする)




markdown.tsxの変数componentsは関数の中に入れました。(コンポーネント呼び出しの都合上)
トグルのレンダリングとテーマ切り替えのための関数は1つのファイルにまとめました。