Repository navigation
fix(web): restore table semantics on the guides and API sites - #4615
Merged
Merged
Conversation
Starlight styles markdown tables with display: block (in @layer starlight.content), which drops the table role in Safari + VoiceOver. The guides site now runs the shared rehype-table-scroll plugin (#4605), which wraps each table in an accessible scroll region, and an unlayered .sl-markdown-content .table-scroll > table rule restores native display. The API site does not use the plugin: Astro runs markdown rehype plugins before rehype-raw, so it would double-wrap the generated parameter tables, which already sit in .wd-params-table with display: table. Its one plain table, the versions list in docs/index.md, is wrapped by hand. Inline code on Starlight pages also gets overflow-wrap: anywhere, matching the blog. Fixes #4608 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Peter Amiri <peter@alurium.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Starlight styles markdown tables with
display: block; overflow: auto, inside@layer starlight.content. On the guides and API sites, that drops the table role in Safari + VoiceOver, the same gap #4575 fixed on the blog.Guides:
rehypeTableScroll(the shared plugin from #4605) is added tomarkdown.rehypePlugins. Each markdown table is wrapped in<div class="table-scroll" role="region" aria-label="Table" tabindex="0">.API: no plugin. Astro runs
markdown.rehypePluginsbeforerehype-raw. The plugin can't see the raw<div class="wd-params-table">around the generated parameter tables, so it would wrap them a second time.display: tableback from.wd-params-table table, so they're left byte-identical.src/content/docs/index.md, is wrapped by hand.astro.config.mjsrecords why.starlight-theme.css:.sl-markdown-content .table-scroll > table { display: table; overflow: visible; }. It's unlayered, so it beats Starlight's layered rule. The wrapper's scroll and focus styles come frombase.css.overflow-wrap: anywhereon.sl-markdown-content :not(pre) > code, matching the blog (web/blog: long inline code makes posts scroll sideways at phone width #4609). Starlight's reset already setsoverflow-wrap: break-wordoncode, so this didn't fix a live overflow; it makes inline code wrap inside tables and flex layouts too.Fixes #4608
Testing
node --test web/packages/ui/src/markdown/rehype-table-scroll.test.mjs: 5/5. The plugin is unchanged.serverpage has 17 tables and 17 wrappers, one each, none nested;configuration/resourcesparameter page has its.wd-params-tableand no.table-scroll, with markup identical to develop;display: table; the parameter tables are stilldisplay: table.guides.pngchanges, because its canary page has a table that's now wrapped with native display.api.pngdoesn't change.🤖 Generated with Claude Code