From 9752af934e65a5b27315569805d53df8cc212346 Mon Sep 17 00:00:00 2001 From: Keldos Date: Sat, 1 Apr 2023 16:42:19 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=E4=BD=BF=E7=94=A8CSS=E5=AE=8C?= =?UTF-8?q?=E5=96=84=E8=A1=A8=E6=A0=BC=E3=80=81=E5=88=97=E8=A1=A8=E3=80=81?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=9D=97=E3=80=81=E5=AF=B9=E8=AF=9D=E6=B0=94?= =?UTF-8?q?=E6=B3=A1=E6=98=BE=E7=A4=BA=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移植了 川虎ChatGPT 的CSS——但是川虎ChatGPT的CSS也是我写的~ --- theme.py | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/theme.py b/theme.py index 14f16fb..fe42c7f 100644 --- a/theme.py +++ b/theme.py @@ -91,4 +91,63 @@ advanced_css = """ border: 1px solid #ddd; padding: 5px; } +# 以下 CSS 来自对 https://github.com/GaiZhenbiao/ChuanhuChatGPT 的移植。 +/* list */ +ol:not(.options), ul:not(.options) { + padding-inline-start: 2em !important; +} +/* 对话气泡 */ +[class *= "message"] { + border-radius: var(--radius-xl) !important; + padding: var(--spacing-xl) !important; + font-size: var(--text-md) !important; + line-height: var(--line-md) !important; + min-height: calc(var(--text-md)*var(--line-md) + 2*var(--spacing-xl)); + min-width: calc(var(--text-md)*var(--line-md) + 2*var(--spacing-xl)); +} +[data-testid = "bot"] { + max-width: 85%; + width: auto !important; + border-bottom-left-radius: 0 !important; +} +[data-testid = "user"] { + max-width: 85%; + width: auto !important; + border-bottom-right-radius: 0 !important; +} +/* 表格 +table { + margin: 1em 0; + border-collapse: collapse; + empty-cells: show; +} +td,th { + border: 1.2px solid var(--border-color-primary) !important; + padding: 0.2em; +} +thead { + background-color: rgba(175,184,193,0.2); +} +thead th { + padding: .5em .2em; +} */ +/* 行内代码 */ +code { + display: inline; + white-space: break-spaces; + border-radius: 6px; + margin: 0 2px 0 2px; + padding: .2em .4em .1em .4em; + background-color: rgba(175,184,193,0.2); +} +/* 代码块 */ +pre code { + display: block; + overflow: auto; + white-space: pre; + background-color: rgba(175,184,193,0.2); + border-radius: 10px; + padding: 1em; + margin: 1em 2em 1em 0.5em; +} """ \ No newline at end of file From b64596de0e54a41799cc3774d2df4442591d5d9c Mon Sep 17 00:00:00 2001 From: Keldos Date: Sat, 1 Apr 2023 16:58:51 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20=E8=B0=83=E6=95=B4=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- theme.py | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/theme.py b/theme.py index fe42c7f..33ce4ca 100644 --- a/theme.py +++ b/theme.py @@ -83,15 +83,23 @@ def adjust_theme(): advanced_css = """ .markdown-body table { - border: 1px solid #ddd; + margin: 1em 0; border-collapse: collapse; + empty-cells: show; } - .markdown-body th, .markdown-body td { - border: 1px solid #ddd; + border: 1.2px solid var(--border-color-primary); padding: 5px; } +.markdown-body thead { + background-color: rgba(175,184,193,0.2); +} +.markdown-body thead th { + padding: .5em .2em; +} + # 以下 CSS 来自对 https://github.com/GaiZhenbiao/ChuanhuChatGPT 的移植。 + /* list */ ol:not(.options), ul:not(.options) { padding-inline-start: 2em !important; @@ -115,22 +123,6 @@ ol:not(.options), ul:not(.options) { width: auto !important; border-bottom-right-radius: 0 !important; } -/* 表格 -table { - margin: 1em 0; - border-collapse: collapse; - empty-cells: show; -} -td,th { - border: 1.2px solid var(--border-color-primary) !important; - padding: 0.2em; -} -thead { - background-color: rgba(175,184,193,0.2); -} -thead th { - padding: .5em .2em; -} */ /* 行内代码 */ code { display: inline; From a469d8714dc9455a6f7cc72e2264141581d41ae2 Mon Sep 17 00:00:00 2001 From: Keldos Date: Sat, 1 Apr 2023 20:34:18 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3CSS=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E6=B3=A8=E9=87=8A=E8=A7=A3=E5=86=B3=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 同时使用.markdown-body缩限了css作用域 --- theme.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/theme.py b/theme.py index 33ce4ca..f5fd02a 100644 --- a/theme.py +++ b/theme.py @@ -98,10 +98,10 @@ advanced_css = """ padding: .5em .2em; } -# 以下 CSS 来自对 https://github.com/GaiZhenbiao/ChuanhuChatGPT 的移植。 +/* 以下 CSS 来自对 https://github.com/GaiZhenbiao/ChuanhuChatGPT 的移植。*/ /* list */ -ol:not(.options), ul:not(.options) { +.markdown-body ol, .markdown-body ul { padding-inline-start: 2em !important; } /* 对话气泡 */ @@ -124,7 +124,7 @@ ol:not(.options), ul:not(.options) { border-bottom-right-radius: 0 !important; } /* 行内代码 */ -code { +.markdown-body code { display: inline; white-space: break-spaces; border-radius: 6px; @@ -133,7 +133,7 @@ code { background-color: rgba(175,184,193,0.2); } /* 代码块 */ -pre code { +.markdown-body pre code { display: block; overflow: auto; white-space: pre;