feat(prose): add table styling support#1063
Conversation
Tables rendered from Markdown (or raw HTML) inside <Prose> were unstyled. Add bordered table styles with a public --reactist-prose-table-border custom property, horizontal scrolling for wide tables, and start-aligned headers that still respect explicit column alignment from Markdown renderers. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
doistbot
left a comment
There was a problem hiding this comment.
This PR introduces robust table styling support to the Prose component, including borders, explicit alignments, and horizontal scrolling for wide tables.
Few things worth tightening:
- Wrapping the table in a focusable overflow container to ensure horizontal scrolling is accessible to keyboard users.
- Adding a wider table to the Storybook fixture so Chromatic exercises the new overflow layout path.
The playground example only shows a narrow table, so Chromatic never exercised the horizontal-scroll layout for wide tables. A dedicated story renders a table with unbreakable links inside a 400px container, guaranteeing the overflow path is snapshotted at any viewport size. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
rfgamaral
left a comment
There was a problem hiding this comment.
Looks good to me 🚀
But here's one suggestion: add more --reactist-prose-* variables that allow consumers to configure the background color of the header row, and the background color of odd and even rows. We can probably leave the Reactist defaults as transparent/inherit/initial (ask your clanker which one is most suited).
Allow consumers to configure the table header row background and odd/even body row backgrounds via --reactist-prose-table-header-fill, --reactist-prose-table-row-odd-fill, and --reactist-prose-table-row-even-fill. All default to transparent, so tables render unchanged unless customized. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
@rfgamaral great suggestion, I've implemented it. Could you please re-check 🙏 |
|
Looks great, merged it for you, @amix. We should get an automated release of this very soon. |
## [33.1.0](v33.0.1...v33.1.0) (2026-06-11) ### Features * **prose:** add table styling support ([#1063](#1063)) ([b02c094](b02c094))
|
🎉 This PR is included in version 33.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Follow-up to https://github.com/Doist/comms-web/pull/395#discussion_r3395143218 — Comms now renders GFM tables in messages and should eventually use
<Prose>instead of its forked prose CSS, but<Prose>had no table styling.Short description
<Prose>, with a new public--reactist-prose-table-bordercustom property (defaults tovar(--reactist-divider-primary)).display: block; width: max-content; max-width: 100%; overflow: auto) instead of stretching the surrounding content, withword-break: normalso cell text doesn't collapse to one character per line under.prose'sbreak-word.th:not([align])guard so explicit column alignment survives both renderer conventions:markedemits the presentationalalignattribute (which author CSS would override without the guard), while react-markdown emits inlinetext-alignstyles (which win regardless).<td><p>…</p></td>) don't get awkward vertical spacing.--reactist-prose-table-header-fill,--reactist-prose-table-row-odd-fill, and--reactist-prose-table-row-even-fillcustom properties (all default totransparent) so consumers can color the header row and stripe body rows, demoed in a "Table colors" story.Smoke tested in Storybook in light and dark playground modes and in the overflow story.
Out of scope
tabindex. Chrome 130+/Firefox handle this natively for scrollers without focusable children; the wrapper belongs at the consumer's renderer level (tracked for the Comms migration). See the resolved review thread for details.PR Checklist
🤖 Generated with Claude Code