Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions web/packages/ui/src/styles/starlight-theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@
padding: 0.1em 0.35em;
font-family: var(--font-mono);
font-size: 0.875em;
/* Long inline code (identifiers, paths) must break inside the column
* rather than push the page sideways at phone width (#4608). Scoped
* away from `pre`, so fenced blocks keep their own scroll. */
overflow-wrap: anywhere;
}

/*
Expand Down Expand Up @@ -199,6 +203,17 @@ starlight-toc a[aria-current='true'] {
word-break: break-word;
}

/* Markdown tables are wrapped in a .table-scroll region by
* rehype-table-scroll.mjs (guides) or hand-written markup (api index). The
* scroll/focus styles come from base.css. Starlight's layered rule sets
* `display: block` on markdown tables, which drops the native table role for
* assistive tech (#4608); restore native display here, unlayered so it beats
* @layer starlight.content. */
.sl-markdown-content .table-scroll > table {
display: table;
overflow: visible;
}

/* ── Prev/Next page footer ─────────────────────────────────────────
* Starlight ships .link-title at 1.5rem which is louder than needed
* on function reference pages where names like clearCachableActions()
Expand Down
6 changes: 6 additions & 0 deletions web/sites/api/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ export default defineConfig({
// See the guides config: content links authored as `/v4-0-0/...` are not
// rewritten by Astro's `base`, so the local bundle prefixes them here.
markdown: {
// Deliberately no rehypeTableScroll here. Astro runs
// markdown.rehypePlugins before rehype-raw, so the plugin cannot see
// the raw <div class="wd-params-table"> wrapper around the generated
// parameter tables and would double-wrap them. The one plain table
// (docs/index.md) is hand-wrapped; the generated tables already get
// display:table back from starlight-theme.css.
rehypePlugins: [
[rehypeBasePrefix, { base: process.env.WHEELS_DOCS_BASE || '' }],
],
Expand Down
4 changes: 4 additions & 0 deletions web/sites/api/src/content/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ from the framework's inline documentation annotations.

## Available versions

<div class="table-scroll" role="region" aria-label="Table" tabindex="0">

| Version | Functions | Status |
| ---------------------- | --------- | --------------- |
| **[v4.2.0](/v4-2-0/)** | 406 | current release |
Expand All @@ -22,6 +24,8 @@ from the framework's inline documentation annotations.
| [v2.0.0](/v2-0-0/) | 254 | |
| [v1.4.5](/v1-4-5/) | 219 | |

</div>

## How to use

Every function page includes:
Expand Down
4 changes: 4 additions & 0 deletions web/sites/guides/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { fileURLToPath } from 'node:url';
import { dirname, resolve } from 'node:path';
import { GUIDES_VERSIONS } from '@wheels-dev/ui/data/versions';
import { rehypeBasePrefix } from '@wheels-dev/ui/markdown/rehype-base-prefix.mjs';
import { rehypeTableScroll } from '@wheels-dev/ui/markdown/rehype-table-scroll.mjs';
import { remarkBasePrefix } from '@wheels-dev/ui/markdown/remark-base-prefix.mjs';
import cfmlGrammar from './languages/cfml.tmLanguage.json';
import cfscriptGrammar from './languages/cfscript.tmLanguage.json';
Expand Down Expand Up @@ -96,6 +97,9 @@ const config = defineConfig({
// rewrites them at build time. No-op when base is unset.
rehypePlugins: [
[rehypeBasePrefix, { base: process.env.WHEELS_DOCS_BASE || '' }],
// Wrap markdown tables in the shared accessible scroll region so
// Starlight's `display: block` stopgap can be overridden (#4608).
rehypeTableScroll,
],
},
redirects: {
Expand Down
Loading