fix: Move table styles to CustomHtml.css.ts

This commit is contained in:
Steffo committed 2026-08-11 04:53:58 +02:00
1 parent fe97dd5a42
commit 6b414d0fca
3 files changed
+50 -20

No files matched your search

@@ -760,6 +760,28 @@ export const getReactCustomHtmlParser = (
);
}
if (name === 'table') {
return (
<table {...props} className={css.Table}>
{renderChildren()}
</table>
);
}
if (name === 'th') {
return (
<th {...props} className={css.Th}>
{renderChildren()}
</th>
);
}
if (name === 'td') {
return (
<td {...props} className={css.Td}>
{renderChildren()}
</td>
);
}
if (name === 'code') {
if (parent && 'name' in parent && parent.name === 'pre') {
const codeContent = renderChildren();
+28
View File
@@ -301,3 +301,31 @@ export const HorizontalRule = style([
userSelect: 'none',
},
]);
export const Table = style([
DefaultReset,
MarginSpaced,
{
borderCollapse: 'collapse',
},
]);
export const Th = style([
DefaultReset,
{
padding: `${config.space.S100}`,
border: `${config.borderWidth.B300} solid var(--sable-surface-container-line)`,
backgroundColor: "var(--sable-surface-var-container)",
color: "var(--sable-surface-var-on-container)",
}
]);
export const Td = style([
DefaultReset,
{
padding: `${config.space.S100}`,
border: `${config.borderWidth.B300} solid var(--sable-surface-container-line)`,
backgroundColor: "var(--sable-surface-container)",
color: "var(--sable-surface-on-container)",
}
])
-20
View File
@@ -148,26 +148,6 @@ pre {
font-variant-ligatures: contextual;
}
table {
border-collapse: collapse;
}
table td,
table th {
padding: 5px;
border: 1px solid var(--sable-surface-container-line);
}
table th {
background-color: var(--sable-surface-var-container);
color: var(--sable-surface-var-on-container);
}
table td {
background-color: var(--sable-surface-container);
color: var(--sable-surface-on-container);
}
/* Accessibility Overrides :D */
.force-underline-links [data-message-id] a:not([data-mention-id]),