Skip to content

Commit 0763559

Browse files
authored
fix(markdown): docs table first column flush against border (padding) (#1770)
1 parent 7fdc1ea commit 0763559

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

packages/plugin-markdown/src/markdown-theme.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,18 @@ const CSS = `
128128
.dark .os-markdown .markdown-alert-important .markdown-alert-title { color: #ab7df8; }
129129
.dark .os-markdown .markdown-alert-warning { border-left-color: #d29922; }
130130
.dark .os-markdown .markdown-alert-warning .markdown-alert-title { color: #d29922; }
131+
132+
/* Bordered tables: @tailwindcss/typography zeroes padding on each row's
133+
first (inline-start) and last (inline-end) cell because it assumes
134+
borderless tables. We add cell borders (prose-th/td:border), so restore
135+
symmetric horizontal padding — otherwise the first column's text sits
136+
flush against the left border, misaligned with every other column. The
137+
0.6666667em matches prose-sm's inner-cell padding. The .os-markdown
138+
class selector outranks typography's zero-specificity :where() rules. */
139+
.os-markdown table th:first-child,
140+
.os-markdown table td:first-child { padding-inline-start: 0.6666667em; }
141+
.os-markdown table th:last-child,
142+
.os-markdown table td:last-child { padding-inline-end: 0.6666667em; }
131143
`
132144

133145
/**

0 commit comments

Comments
 (0)