Spaces:
Runtime error
Runtime error
Merge branch 'CSS' of https://github.com/Keldos-Li/chatgpt_academic (#236)
Browse files
theme.py
CHANGED
@@ -83,12 +83,63 @@ def adjust_theme():
|
|
83 |
|
84 |
advanced_css = """
|
85 |
.markdown-body table {
|
86 |
-
|
87 |
border-collapse: collapse;
|
|
|
88 |
}
|
89 |
-
|
90 |
.markdown-body th, .markdown-body td {
|
91 |
-
border:
|
92 |
padding: 5px;
|
93 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
"""
|
|
|
83 |
|
84 |
advanced_css = """
|
85 |
.markdown-body table {
|
86 |
+
margin: 1em 0;
|
87 |
border-collapse: collapse;
|
88 |
+
empty-cells: show;
|
89 |
}
|
|
|
90 |
.markdown-body th, .markdown-body td {
|
91 |
+
border: 1.2px solid var(--border-color-primary);
|
92 |
padding: 5px;
|
93 |
}
|
94 |
+
.markdown-body thead {
|
95 |
+
background-color: rgba(175,184,193,0.2);
|
96 |
+
}
|
97 |
+
.markdown-body thead th {
|
98 |
+
padding: .5em .2em;
|
99 |
+
}
|
100 |
+
|
101 |
+
/* 以下 CSS 来自对 https://github.com/GaiZhenbiao/ChuanhuChatGPT 的移植。*/
|
102 |
+
|
103 |
+
/* list */
|
104 |
+
.markdown-body ol, .markdown-body ul {
|
105 |
+
padding-inline-start: 2em !important;
|
106 |
+
}
|
107 |
+
/* 对话气泡 */
|
108 |
+
[class *= "message"] {
|
109 |
+
border-radius: var(--radius-xl) !important;
|
110 |
+
padding: var(--spacing-xl) !important;
|
111 |
+
font-size: var(--text-md) !important;
|
112 |
+
line-height: var(--line-md) !important;
|
113 |
+
min-height: calc(var(--text-md)*var(--line-md) + 2*var(--spacing-xl));
|
114 |
+
min-width: calc(var(--text-md)*var(--line-md) + 2*var(--spacing-xl));
|
115 |
+
}
|
116 |
+
[data-testid = "bot"] {
|
117 |
+
max-width: 85%;
|
118 |
+
width: auto !important;
|
119 |
+
border-bottom-left-radius: 0 !important;
|
120 |
+
}
|
121 |
+
[data-testid = "user"] {
|
122 |
+
max-width: 85%;
|
123 |
+
width: auto !important;
|
124 |
+
border-bottom-right-radius: 0 !important;
|
125 |
+
}
|
126 |
+
/* 行内代码 */
|
127 |
+
.markdown-body code {
|
128 |
+
display: inline;
|
129 |
+
white-space: break-spaces;
|
130 |
+
border-radius: 6px;
|
131 |
+
margin: 0 2px 0 2px;
|
132 |
+
padding: .2em .4em .1em .4em;
|
133 |
+
background-color: rgba(175,184,193,0.2);
|
134 |
+
}
|
135 |
+
/* 代码块 */
|
136 |
+
.markdown-body pre code {
|
137 |
+
display: block;
|
138 |
+
overflow: auto;
|
139 |
+
white-space: pre;
|
140 |
+
background-color: rgba(175,184,193,0.2);
|
141 |
+
border-radius: 10px;
|
142 |
+
padding: 1em;
|
143 |
+
margin: 1em 2em 1em 0.5em;
|
144 |
+
}
|
145 |
"""
|