Skip to content

Commit 665ca75

Browse files
committed
fix(markdown): tables scale with reading-mode font size
1 parent df39b79 commit 665ca75

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

front/src/components/features/blog/MarkdownRenderer/MarkdownRenderer.jsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,26 +1048,27 @@ const BlogMarkdownRenderer = memo(({ content, className = "", baseImagePath = ""
10481048
</blockquote>
10491049
),
10501050

1051-
// Enhanced tables
1051+
// Editorial tables — em-based padding so they scale with font-size,
1052+
// hairline borders only (no boxy chrome), color inherits from parent (RM theme aware).
10521053
table: ({ children, ...props }) => (
1053-
<div className="my-6 overflow-x-auto">
1054-
<table className="w-full border-collapse border border-gray-300 dark:border-gray-600 rounded-lg overflow-hidden" {...props}>
1054+
<div className="my-[1.5em] -mx-4 sm:mx-0 overflow-x-auto [&::-webkit-scrollbar]:h-1 [&::-webkit-scrollbar-thumb]:bg-current/20">
1055+
<table className="w-full border-collapse text-[0.92em] mx-4 sm:mx-0" style={{ minWidth: 'max-content' }} {...props}>
10551056
{children}
10561057
</table>
10571058
</div>
10581059
),
10591060
thead: ({ children, ...props }) => (
1060-
<thead className="bg-gray-100 dark:bg-gray-800" {...props}>
1061+
<thead {...props}>
10611062
{children}
10621063
</thead>
10631064
),
10641065
th: ({ children, ...props }) => (
1065-
<th className="px-4 py-3 text-left font-semibold text-gray-900 dark:text-gray-100 border border-gray-300 dark:border-gray-600" {...props}>
1066+
<th className="px-[0.9em] py-[0.55em] text-left font-semibold whitespace-nowrap border-b-2 border-current/30" {...props}>
10661067
{children}
10671068
</th>
10681069
),
10691070
td: ({ children, ...props }) => (
1070-
<td className="px-4 py-3 text-gray-700 dark:text-gray-300 border border-gray-300 dark:border-gray-600" {...props}>
1071+
<td className="px-[0.9em] py-[0.5em] align-top border-b border-current/10" {...props}>
10711072
{children}
10721073
</td>
10731074
),

0 commit comments

Comments
 (0)