Skip to content

Commit 22e6f5b

Browse files
steipeteampagent
andauthored
improve(ui): polish Markdown tables (#121390)
Co-authored-by: Amp <[email protected]>
1 parent 8ab7ac5 commit 22e6f5b

1 file changed

Lines changed: 44 additions & 7 deletions

File tree

‎ui/src/styles/chat/text.css‎

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,33 @@
8282
:where(p + ...) spacing rule below which intentionally omits table. */
8383
.chat-text :where(table) {
8484
margin-top: 0.75em;
85-
border-collapse: collapse;
85+
border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--border));
86+
border-radius: var(--radius-md);
87+
border-collapse: separate;
88+
border-spacing: 0;
8689
width: 100%;
8790
max-width: 100%;
91+
background: color-mix(in srgb, var(--accent) 2%, var(--bg-elevated));
92+
box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 4%, transparent);
8893
font-size: 13px;
8994
display: block;
9095
overflow-x: auto;
9196
}
9297

9398
.chat-text :where(th, td) {
94-
border: 1px solid var(--border);
95-
padding: 6px 10px;
96-
vertical-align: top;
99+
padding: 8px 12px;
100+
border-right: 1px solid color-mix(in srgb, var(--accent) 12%, var(--border));
101+
border-bottom: 1px solid color-mix(in srgb, var(--accent) 12%, var(--border));
102+
text-align: left;
103+
vertical-align: middle;
104+
}
105+
106+
.chat-text :where(th:last-child, td:last-child) {
107+
border-right: none;
108+
}
109+
110+
.chat-text :where(tbody tr:last-child td) {
111+
border-bottom: none;
97112
}
98113

99114
.chat-text :where(th:first-child, td:first-child) {
@@ -103,10 +118,32 @@
103118
}
104119

105120
.chat-text :where(th) {
106-
font-family: var(--mono);
121+
border-bottom-color: color-mix(in srgb, var(--accent) 28%, var(--border));
122+
background: linear-gradient(
123+
180deg,
124+
color-mix(in srgb, var(--accent) 10%, var(--secondary)),
125+
color-mix(in srgb, var(--accent) 6%, var(--secondary))
126+
);
127+
color: var(--text-strong);
128+
font-family: var(--font-body);
129+
font-weight: 600;
130+
}
131+
132+
.chat-text :where(tbody tr) {
133+
transition: background var(--duration-fast) ease;
134+
}
135+
136+
.chat-text :where(tbody tr:nth-child(even)) {
137+
background: color-mix(in srgb, var(--accent) 3%, transparent);
138+
}
139+
140+
.chat-text :where(tbody tr:hover) {
141+
background: color-mix(in srgb, var(--accent) 7%, var(--bg-elevated));
142+
}
143+
144+
.chat-text :where(tbody td:first-child) {
145+
color: var(--text-strong);
107146
font-weight: 500;
108-
color: var(--muted);
109-
background: var(--secondary);
110147
}
111148

112149
.chat-text :where(ul, ol) {

0 commit comments

Comments
 (0)