Spaces:
Paused
Paused
Keldos
commited on
Commit
•
9752af9
1
Parent(s):
70d9300
feat: 使用CSS完善表格、列表、代码块、对话气泡显示样式
Browse files移植了 川虎ChatGPT 的CSS——但是川虎ChatGPT的CSS也是我写的~
theme.py
CHANGED
@@ -91,4 +91,63 @@ advanced_css = """
|
|
91 |
border: 1px solid #ddd;
|
92 |
padding: 5px;
|
93 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
"""
|
|
|
91 |
border: 1px solid #ddd;
|
92 |
padding: 5px;
|
93 |
}
|
94 |
+
# 以下 CSS 来自对 https://github.com/GaiZhenbiao/ChuanhuChatGPT 的移植。
|
95 |
+
/* list */
|
96 |
+
ol:not(.options), ul:not(.options) {
|
97 |
+
padding-inline-start: 2em !important;
|
98 |
+
}
|
99 |
+
/* 对话气泡 */
|
100 |
+
[class *= "message"] {
|
101 |
+
border-radius: var(--radius-xl) !important;
|
102 |
+
padding: var(--spacing-xl) !important;
|
103 |
+
font-size: var(--text-md) !important;
|
104 |
+
line-height: var(--line-md) !important;
|
105 |
+
min-height: calc(var(--text-md)*var(--line-md) + 2*var(--spacing-xl));
|
106 |
+
min-width: calc(var(--text-md)*var(--line-md) + 2*var(--spacing-xl));
|
107 |
+
}
|
108 |
+
[data-testid = "bot"] {
|
109 |
+
max-width: 85%;
|
110 |
+
width: auto !important;
|
111 |
+
border-bottom-left-radius: 0 !important;
|
112 |
+
}
|
113 |
+
[data-testid = "user"] {
|
114 |
+
max-width: 85%;
|
115 |
+
width: auto !important;
|
116 |
+
border-bottom-right-radius: 0 !important;
|
117 |
+
}
|
118 |
+
/* 表格
|
119 |
+
table {
|
120 |
+
margin: 1em 0;
|
121 |
+
border-collapse: collapse;
|
122 |
+
empty-cells: show;
|
123 |
+
}
|
124 |
+
td,th {
|
125 |
+
border: 1.2px solid var(--border-color-primary) !important;
|
126 |
+
padding: 0.2em;
|
127 |
+
}
|
128 |
+
thead {
|
129 |
+
background-color: rgba(175,184,193,0.2);
|
130 |
+
}
|
131 |
+
thead th {
|
132 |
+
padding: .5em .2em;
|
133 |
+
} */
|
134 |
+
/* 行内代码 */
|
135 |
+
code {
|
136 |
+
display: inline;
|
137 |
+
white-space: break-spaces;
|
138 |
+
border-radius: 6px;
|
139 |
+
margin: 0 2px 0 2px;
|
140 |
+
padding: .2em .4em .1em .4em;
|
141 |
+
background-color: rgba(175,184,193,0.2);
|
142 |
+
}
|
143 |
+
/* 代码块 */
|
144 |
+
pre code {
|
145 |
+
display: block;
|
146 |
+
overflow: auto;
|
147 |
+
white-space: pre;
|
148 |
+
background-color: rgba(175,184,193,0.2);
|
149 |
+
border-radius: 10px;
|
150 |
+
padding: 1em;
|
151 |
+
margin: 1em 2em 1em 0.5em;
|
152 |
+
}
|
153 |
"""
|