Skip to content

GhostCodeBlock, clipboard helper, and prose styles specification ​

Important

Status: Approved on 2026-12-01 by zprue743 for 0.4.0 (see Approval). This specification covers three related pieces for documentation-style sites, which ship as two builds:

  1. useGhostClipboard and writeClipboardText, a copy-to-clipboard helper with a status announcement and a defined failure path (Clipboard helper).
  2. GhostCodeBlock, a headless code block shell around consumer-highlighted markup, with a header, a copy action, horizontal scroll, and an optional fold (Public API).
  3. .ghost-prose, a themed style scope for long-form content: headings, lists, inline code, tables, and the rest of an article (Prose styles).

The design decisions D1–D12 are listed under Design decisions and folded into the sections below.

Purpose and user problems ​

App builders who write documentation sites, changelogs, and help centers on GhostVue hand-assemble every code sample today: a GhostCard, a file name in a GhostBadge, a <pre> inside a horizontal GhostScrollArea, a GhostCollapsible fold, and a copy button that raises a toast. There is no clipboard primitive, so each app writes its own navigator.clipboard wrapper and usually forgets the failure path (insecure origins, denied permission, embedded frames). There is no style scope for article content, so each page carries its own CSS for headings, lists, inline code, and tables.

The GhostVue docs site solves the same problems locally. Its markdown fences and example source strips share one clipboard helper, a constant button name, a polite role="status" region, an out-of-order guard for overlapping writes, a select-the-code fallback when the write fails, and a visible failure message. None of it is exported.

This specification makes those solutions public:

  • A consumer copies text with one call and gets a state they can render, a status message for assistive technology, and a failure they can recover from.
  • A consumer renders a code sample from markup their own highlighter produced (Shiki, Prism, highlight.js, or none), with a header, a copy action, a horizontally scrolling body, and an optional fold for long samples, without GhostVue bundling a highlighter.
  • A consumer adds one class to an article and gets themed typography that follows color mode and density.

Non-goals ​

  • Syntax highlighting. GhostVue does not bundle, wrap, or pick a highlighter, and adds no runtime dependency (dependency policy). GhostCodeBlock renders whatever markup the consumer puts in its default slot. It never calls v-html; a consumer who renders highlighter HTML makes that trust decision in their own template (D3).
  • Highlighter themes. Token colors come from the consumer's highlighter (inline styles or classes). The recipe paints the surface, border, header, and default text color only. The documentation shows a dual-theme Shiki setup that follows data-ghost-mode, as an example, not a contract.
  • Line numbers, line highlighting, diff markers, and word wrap. Each depends on per-line markup that differs between highlighters. The stable hooks let a consumer add them with CSS; the documentation shows a line-number counter for Shiki's .line spans. A later spec can add them.
  • Tabs between several files or languages. Compose GhostTabs around several code blocks.
  • Editing. A code block is read-only. Code editors are out of scope.
  • A rich-text editor or a markdown renderer. Prose styles apply to HTML the consumer already has.
  • Print styles. Tracked separately as app-builder feedback item G15.
  • A copy-on-select or copy-anything directive. The helper is a composable; a consumer binds it to any control.
  • A document.execCommand('copy') fallback (D2).
  • Prose size variants (sm / lg). Density already tightens or loosens rhythm. A size modifier can be added later without breaking the scope.
  • Changing the docs site's markdown fences to GhostCodeBlock. VitePress owns that markup; see Docs site adoption.

Public API ​

Exports ​

From @ghostvue/vue:

  • GhostCodeBlock (headless component)
  • useGhostCodeBlock (composable behind the component, for fully custom markup)
  • useGhostClipboard (clipboard state, announcement, and failure handling)
  • writeClipboardText (stateless write; resolves a boolean, never throws)
  • Types: GhostCodeBlockProps, GhostCodeBlockEmits, GhostCodeBlockSlots, GhostCodeBlockExposed, GhostCodeBlockMessages, GhostCodeBlockCopySettledEvent, UseGhostCodeBlockOptions, UseGhostCodeBlockReturn, GhostClipboardState, GhostClipboardMessages, GhostClipboardAnnouncement, UseGhostClipboardOptions, UseGhostClipboardReturn

From @ghostvue/themes:

  • GhostCodeBlock (themed wrapper, same props, events, slots, and exposed members as the headless component)
  • recipes/code-block.css and recipes/prose.css (both also in default.css)
  • The .ghost-prose and .ghost-not-prose classes and the --ghost-prose-scroll-margin custom property (Prose styles)
  • The semantic token --ghost-type-family-mono (D10)

Clipboard helper ​

writeClipboardText(text) ​

ts
function writeClipboardText(text: string): Promise<boolean>

Writes text with navigator.clipboard.writeText. The call to writeText happens synchronously inside writeClipboardText, before any await, so the write stays inside the user gesture that triggered it (Safari rejects writes that start after the gesture). Resolves true when the write succeeds. Resolves false, and never rejects or throws, when:

  • it runs outside a browser (no navigator, as during SSR);
  • the Clipboard API is missing (insecure origins hide navigator.clipboard; some embedded webviews omit it);
  • the write is rejected: permission denied, the document is not focused, the call came after the user gesture ended, or a cross-origin frame lacks the clipboard-write permission policy.

It has no state, timers, or Vue dependency, so non-component code (the docs site's markdown fence enhancer) can call it. An empty string is written as an empty string.

useGhostClipboard(options?) ​

ts
type GhostClipboardState = 'idle' | 'copied' | 'failed'

interface GhostClipboardMessages {
  /** Announced after a successful write. */
  copied: string
  /** Announced after a failed write. */
  failed: string
}

interface GhostClipboardAnnouncement {
  /** Changes on every announcement, so equal consecutive texts re-announce. */
  key: number
  text: string
}

interface UseGhostClipboardOptions {
  /**
   * How long `copied` lasts before `state` returns to `idle`, in ms.
   * Default 2000. `0`, a negative number, or a non-finite number keeps
   * `copied` until the next `copy()` or `reset()`.
   */
  copiedDuration?: MaybeRefOrGetter<number>
  /** Overrides for the announced texts. Read when each write settles. */
  messages?: MaybeRefOrGetter<Partial<GhostClipboardMessages> | undefined>
}

interface UseGhostClipboardReturn {
  state: Readonly<Ref<GhostClipboardState>>
  announcement: Readonly<Ref<GhostClipboardAnnouncement>>
  /** Spread on the element that renders `announcement.text`. */
  liveRegionProps: ComputedRef<{
    role: 'status'
    'aria-live': 'polite'
    'aria-atomic': 'true'
  }>
  /** Writes `text`; resolves the write result. Never rejects. */
  copy: (text: string) => Promise<boolean>
  /** Returns to `idle`, clears the timer and the announcement text. */
  reset: () => void
}

Default messages: copied is 'Copied'; failed is 'Copy failed.'. The code block passes a longer failure message that tells the reader the code is selected (Copy action); a bare helper cannot promise a selection, so its default does not.

aria-live and aria-atomic repeat what role="status" implies. They are kept on purpose, as in useGhostFileUpload, for screen readers that only honor the explicit attributes.

Contract:

  1. copy(text) synchronously sets state to idle, empties announcement.text, clears any timer, and calls writeClipboardText(text) in the same tick, with no await before the write. A consumer who calls copy() from their own control (for example in the code block's actions slot) must call it directly from the event handler, not after their own await.
  2. When the write settles, and only if this call is still the latest copy() and the scope is not disposed:
    • success sets state to copied, announces messages.copied, and starts the copiedDuration timer. When the timer fires, state returns to idle and announcement.text empties (emptying is silent).
    • failure sets state to failed and announces messages.failed. failed stays until the next copy() or reset(), so the failure text stays readable.
  3. A call that is no longer the latest still resolves its own boolean, but it changes no state and announces nothing. A permission prompt can hold one write back; an older write that settles late must not replace a newer result (D4).
  4. Each announcement increments announcement.key. A consumer renders the text in a keyed child of the live region (<span :key="announcement.key">) so that two equal texts in a row are announced twice. This is the useGhostFileUpload announcer pattern, and it needs no tick between clearing and announcing.
  5. On scope disposal the timer is cleared and pending writes are ignored when they settle.
  6. The composable works in any effect scope. It does not require a component instance, and it touches no browser API until copy() runs.

The helper does not render, select text, or show a toast. Those belong to the caller. GhostCodeBlock uses it and adds the selection fallback.

Props and configuration ​

GhostCodeBlock props (headless and themed are identical):

PropTypeDefaultContract
codestringrequiredThe raw source text. It is what Copy writes (unless copyText is set), what the line count is taken from, and what renders as escaped text when the default slot is empty.
copyTextstring | undefinedundefinedText Copy writes instead of code, for example a shell sample without its $ prompts. The failure fallback also puts this text on the clipboard (Copy action).
titlestring | undefinedundefinedHeader title, usually a file name. It also names the copy button and, through the title element, the code region (Semantics).
languagestring | undefinedundefinedLanguage label rendered in the header (for example ts). Also set as data-language on the root and as the class language-<language> on <code>.
copyablebooleantrueRenders the copy button. false removes it; the status region stays whenever the header renders, so a custom copy control in actions is still announced.
foldLinesnumber | undefinedundefinedEnables the fold when the sample has more lines than this. Must be a positive integer; any other value logs a development warning and disables the fold.
expandedboolean | undefinedundefinedControlled fold state (v-model:expanded). Ignored, with no warning, when the fold is not active.
defaultExpandedbooleanfalseInitial fold state in uncontrolled mode.
copiedDurationnumber2000Passed to useGhostClipboard.
messagesPartial<GhostCodeBlockMessages>{}Text overrides, merged over the defaults below. Read at render and when a write settles, so a reactive object updates later output.

The title prop takes the place of the native title attribute on this component; a tooltip title on the root is not supported. Other native attributes and listeners fall through to the root element. The component owns data-part, data-language, and data-fold on the root.

ts
interface GhostCodeBlockMessages {
  /** Visible copy button text, in every state. */
  copy: string
  /** Announcement after a successful copy. */
  copied: string
  /** Announcement and visible status text after a failed copy. */
  failed: string
  /** Accessible name of the copy button, from the `title` prop. */
  copyLabel: (title: string | undefined) => string
  /** Accessible name of the code region when no title element renders. */
  regionLabel: (language: string | undefined) => string
  /** Fold toggle text while collapsed. */
  expand: (lineCount: number) => string
  /** Fold toggle text while expanded. */
  collapse: string
}
MessageDefault
copy'Copy'
copied'Copied'
failed'Copy failed. The code is now selected; copy it with Ctrl+C, ⌘C, or your device's Copy menu.'
copyLabeltitle ? \Copy ${title}` : 'Copy code'`
regionLabellanguage ? \${language} code` : 'Code'`
expand`Show all ${lineCount} lines`
collapse'Show fewer lines'

The copy button's visible text is messages.copy in every state, and its accessible name starts with that word, so voice control users can say "click Copy" at any time (label in name, D7). Success shows through data-state="copied" and the announcement, not a text change.

Line count. Remove one trailing line break (\n or \r\n) from code. If the result is empty, the count is 0. Otherwise the count is the number of line breaks plus one, where \r\n counts once. So '' and '\n' are 0, 'a' and 'a\n' are 1, and 'a\n\nb' is 3. The count is computed from code, not from the slot markup, so the consumer must render the same lines they pass in code.

Fold active. The fold is active when foldLines is a positive integer and the line count is greater than foldLines. A sample that fits renders no fold toggle and no fold hooks, even when foldLines is set.

v-model contracts ​

expanded follows useControllableState, as GhostCollapsible's open does:

  • With expanded omitted, internal state starts at defaultExpanded and the toggle updates it, still emitting update:expanded.
  • With expanded bound, the toggle emits update:expanded and the consumer owns the update.
  • defaultExpanded is read once at setup.
  • Focus entering clipped content requests expansion through the same path (Fold).
  • When code changes so that the fold becomes inactive, the toggle unmounts; the stored state is kept and applies again if the fold becomes active.

Events, callbacks, slots, and exposed methods ​

Events:

EventPayloadTiming
update:expanded[expanded: boolean]On fold toggle activation, or when focus enters clipped content while collapsed.
copySettled[event: GhostCodeBlockCopySettledEvent]After a write settles, only for the latest request (the rule in the clipboard contract, item 3).
ts
interface GhostCodeBlockCopySettledEvent {
  /** The text that was written (`copyText ?? code` at activation time). */
  text: string
  ok: boolean
}

The event is named copySettled, not copy, so that @copy on the component keeps meaning the native DOM copy event on the root, and because it fires on failure as well as success. It lets an app add its own feedback (a toast, analytics). The component already announces the result, so a toast is optional.

Slots:

SlotSlot propsRenders insideContract
defaultnone<code data-part="code">The highlighted markup, following the content model. When the slot is empty, code renders as escaped text.
titlenone[data-part="title"]Replaces the title text, for example a file icon plus name. The region is named by this element. The copy button name still comes from the title prop, so pass both.
actions{ copy: () => Promise<boolean>, state: GhostClipboardState }the header, before the copy buttonExtra header controls (an "Open in playground" link, or a custom copy button with copyable set to false). Consumers own their names. copy must be called directly from the event handler.
copy{ state: GhostClipboardState }<button data-part="copy">Replaces the copy button's visible content, for example an icon. The button keeps its aria-label, so icon-only content stays named (ADR 0013).

Exposed (template ref):

ts
interface GhostCodeBlockExposed {
  element: HTMLElement | null
  /** Runs the same copy as the button, including the failure fallback. */
  copy: () => Promise<boolean>
}

element is null before mount and after unmount, as in GhostCollapsible.

Slot content model ​

The default slot is phrasing content placed inside the component's <pre><code>. It must not contain a <pre> or <code> element of its own. The supported recipe for each common highlighter, used verbatim as test fixtures:

HighlighterSupported output
ShikicodeToHtml(code, { …, structure: 'inline' }) rendered with v-html on a <span>, or codeToTokens / codeToHast rendered as Vue nodes. Not the default codeToHtml output, which brings its own <pre><code>.
PrismPrism.highlight(code, grammar, language) rendered with v-html on a <span>. Prism theme selectors such as code[class*='language-'] match because <code> carries language-<language>.
highlight.jshljs.highlight(code, { language }).value rendered with v-html on a <span>. Token classes (.hljs-keyword) work anywhere; the recipe paints the container instead of .hljs.

The slot is empty when it is not provided, or when it renders only comments and whitespace text (for example a v-if that is still false while an async highlighter loads). An empty slot renders code as escaped text.

In development, after mount and after each slot update, the component logs a warning (a new code in dev-codes.ts) when it finds a <pre> inside <code data-part="code">.

useGhostCodeBlock ​

ts
function useGhostCodeBlock(
  options: UseGhostCodeBlockOptions,
): UseGhostCodeBlockReturn

UseGhostCodeBlockOptions takes the component props as MaybeRefOrGetter values, plus onUpdateExpanded and onCopySettled callbacks. The return value holds everything the component renders, so a consumer can build their own markup with identical behavior:

  • state: lineCount, foldActive, expanded, clipboardState, announcement, viewportOverflow
  • actions: copy(), toggle()
  • template refs: rootRef, titleRef, viewportRef, codeRef, foldToggleRef
  • prop bags to spread: rootProps, headerProps, titleProps, languageProps, copyButtonProps, statusProps, viewportProps, codeProps, foldToggleProps

Each prop bag carries the ids, ARIA attributes, data-* hooks, inline styles, and listeners listed under Semantics and Rendering and customization. The component is a thin template over this composable, as with the other useGhost* composables. The region name rule needs to know whether a title element rendered; the composable reads that from titleRef.

State model ​

Three independent pieces of state:

StateValuesOwner
Clipboardidle, copied, failedInternal (useGhostClipboard), read via slots
Foldcollapsed, expandedControlled or uncontrolled (expanded)
Viewport overflownone, horizontalMeasured after mount (Composition)

Clipboard transitions: idle → idle (a new copy() resets first) → copied → idle (timer) or → failed. copied or failed → idle on the next copy() or reset().

Fold transitions: collapsed ↔ expanded on the toggle, on a controlled prop change, or collapsed → expanded when focus enters clipped content. A collapsed fold clips the code visually (Fold); it does not remove lines from the DOM.

Loading, empty, disabled, read-only, and error states ​

  • Empty code. code === '' renders an empty <pre>. The line count is 0, so the fold is inactive. Copy stays enabled and writes an empty string; an app that does not want that sets copyable to false.
  • Copy failed. See Copy action. The failure is not an error state of the component; nothing else changes.
  • Disabled and read-only. Not applicable. A code block is always read-only. There is no disabled prop; copyable removes the action instead of disabling it, so no dead control stays in the tab order.
  • Loading. Not applicable as a state. A consumer that highlights asynchronously keeps the default slot empty (as defined in the content model) until the highlighter resolves, so the plain code shows first. Line count and copy work from code the whole time, so nothing moves except token colors.

Async behavior ​

The only async work is the clipboard write. Races, staleness, and disposal follow the clipboard contract (items 2, 3, 5). The selection fallback runs only for the latest failed write and only while the component is mounted.

Consumer data ​

  • code, copyText, title, and language are strings read on render. They are never mutated or retained beyond the current render.
  • The default slot is consumer markup. The component never parses, sanitizes, or rewrites it. When the consumer renders highlighter output with v-html, they are responsible for that HTML being safe; highlighters escape the source they tokenize, and the documentation says so next to the example.
  • The component does not read the slot's text to decide what to copy. Copy writes the string props, so ignored markup (diff removal lines, prompts the slot renders with user-select: none) never leaks into the clipboard by accident (D5). It does inspect the slot's DOM for tabbable descendants and nested <pre> elements (Performance).

Accessibility contract ​

Semantics and relationships ​

Rendered structure (headless, all parts present, collapsed, overflowing):

html
<div data-part="root" data-language="ts" data-fold="collapsed">
  <div data-part="header">
    <span data-part="title" id="t">app.ts</span>
    <span data-part="language">ts</span>
    <!-- actions slot -->
    <button
      type="button"
      data-part="copy"
      data-state="idle"
      aria-label="Copy app.ts"
    >
      Copy
    </button>
    <span
      data-part="status"
      data-state="idle"
      role="status"
      aria-live="polite"
      aria-atomic="true"
      style="/* visually hidden while idle or copied */"
    ></span>
  </div>
  <pre
    data-part="viewport"
    dir="ltr"
    aria-labelledby="t"
    data-overflow="horizontal"
    tabindex="0"
    role="region"
  ><code
    data-part="code"
    class="language-ts"
    translate="no"
    data-state="collapsed"
    style="display: block; --ghost-code-block-fold-lines: 12; …"
  >…</code></pre>
  <button type="button" data-part="fold-toggle" data-state="collapsed">
    Show all 42 lines
  </button>
</div>
  • Root is a <div> with no role. A code block is content, not a landmark (D6).
  • Header renders when any of title, the title slot, language, the actions slot, or copyable applies. It has no role.
  • Title is plain text. A consumer who wants it to be a heading puts a heading in the title slot.
  • Language label is plain text and stays exposed to assistive technology even when a title is present, because a title such as "Terminal" does not say which language follows.
  • Viewport is the <pre>, and it is the horizontal scroll container. It carries dir="ltr" so code keeps its reading order on right-to-left pages; the header follows the page direction. It follows the GhostScrollArea tab-stop rule: it gets tabindex="0" only after mount, only while its content overflows horizontally, and only when it holds no tabbable descendants. While it is a tab stop it has role="region" and a name: aria-labelledby the title element whenever one renders (from the title prop or the title slot), otherwise aria-label from messages.regionLabel(language). When it is not a tab stop it has no role and no name, so screen readers do not announce an empty region around short samples. This keeps the existing GhostScrollArea rule; including the language in the fallback name keeps a page of untitled samples from listing many regions all named "Code".
  • Code is a <code> element inside the <pre>, with translate="no" so page translation does not rewrite identifiers, and class="language-<language>" when language is set. The slot markup inside it is left as is.
  • Copy button is a native <button type="button">. Its accessible name is messages.copyLabel(title) and never changes with state. Its visible text is messages.copy in every state (D7). It carries data-state; it does not use aria-pressed, because copy is an action, not a toggle.
  • Status region renders whenever the header renders, independent of copyable, and it is in the server markup, so it exists before its first message (screen readers ignore live regions inserted at the same moment as their text). It carries data-state (idle, copied, failed). While idle or copied the headless component hides it visually with the GhostVisuallyHidden inline styles. While failed it drops those inline styles, so the failure message is visible in headless and themed use alike, and the recipe styles it.
  • Fold toggle is a native <button type="button"> after the viewport. It has no aria-expanded or aria-controls: a collapsed fold hides nothing from assistive technology, so announcing "collapsed" would misstate the content (D8). Its text says what activating it does (Show all 42 lines / Show fewer lines) and data-state carries the state for styling.

Keyboard interaction ​

No custom key handlers. Native behavior only:

KeyTargetBehavior
Tab / Shift+Tabwhole blockHeader actions, copy button, viewport (when a tab stop) or tabbables inside it, fold toggle.
Enter, Spacecopy buttonCopies.
Enter, Spacefold toggleToggles the fold.
Arrow keys, Home/EndviewportNative scrolling of the focused <pre>.
Ctrl+C / ⌘CanywhereNative copy of the current selection, which is how the failure fallback completes.

Focus behavior ​

  • Copying never moves focus. The status region announces the result.
  • On failure the component selects the contents of <code> with the Selection API. Focus stays on the copy button. Browsers copy the document selection on Ctrl+C / ⌘C while a button has focus, so the reader can complete the copy without moving.
  • When focus enters any element inside <code> while the fold is collapsed (a link or a popover trigger in the slot markup), the component requests expansion through update:expanded, so focus never lands in clipped, invisible content. In uncontrolled mode it expands. In controlled mode it emits only; the consumer is expected to apply it.
  • Toggling the fold keeps focus on the toggle. After collapsing, if the toggle has moved out of the viewport, it is scrolled back into view with scrollIntoView({ block: 'nearest' }), so a keyboard user does not lose their place under a long sample.
  • Visible focus uses the theme focus ring on the copy button, the fold toggle, and the viewport (when it is a tab stop).

Assistive technology expectations ​

  • Success: "Copied" is announced politely. The button name stays "Copy app.ts" and its visible text stays "Copy".
  • Failure: the full failure message is announced, shown below the header, and the code is selected.
  • Copying the same sample twice announces "Copied" twice (keyed announcement).
  • The fold toggle reads as "Show all 42 lines, button".
  • A collapsed fold clips the code visually only. Screen readers reach every line, and the failure fallback copies the full text. Known limitation: find-in-page counts matches in clipped lines but cannot reveal them until the reader expands the sample. The documentation says so.
  • Forced colors: the copy button and fold toggle keep a visible border (ButtonText); the fold fade is removed so clipped text ends at a hard edge.

Rendering and customization ​

Layers, from simplest to most custom:

  1. Themed GhostCodeBlock from @ghostvue/themes with code, title, and a highlighted default slot.
  2. Messages and slots: messages for wording, title and copy slots for icons, actions for extra controls.
  3. Headless GhostCodeBlock with the consumer's own CSS on the hooks below.
  4. useGhostCodeBlock with fully custom markup.
  5. useGhostClipboard alone for copy buttons that are not code blocks.

Stable styling hooks (recorded in the manifest's styling block):

HookValues
data-partroot, header, title, language, copy, status, viewport, code, fold-toggle
root data-languagethe language prop, when set
root data-foldcollapsed, expanded; absent when the fold is inactive
copy and status data-stateidle, copied, failed
code and fold toggle data-statecollapsed, expanded; absent on code when the fold is inactive
viewport data-overflownone, horizontal
code class language-<language>when language is set
--ghost-code-block-fold-lines (custom property on code)the foldLines value while the fold is active

Internal wrapper nesting and other class names are not part of the contract. A consumer styles the code element through the root (.my-sample [data-part='code']) or the language class.

Fold ​

While the fold is active, the headless component sets display: block and --ghost-code-block-fold-lines on <code data-part="code"> in both fold states, so the box does not change type on toggle. While collapsed it also sets:

css
max-block-size: calc(var(--ghost-code-block-fold-lines) * 1lh);
overflow-y: clip;

overflow-y: clip clips vertically without making <code> a scroll container, so the <pre> keeps scrolling horizontally. The clip is part of headless behavior, so an unthemed block still folds. Expanded, the two collapsed styles are removed. When the fold is inactive, no inline styles are set and the consumer's display applies.

Guarantee: the code element is clipped at foldLines × 1lh of its own line height. That shows exactly foldLines lines when the line height is a number or a length and every line box shares it. The themed recipe sets a numeric line height, so themed blocks show exactly foldLines lines. Headless use with line-height: normal, or lines with taller fallback glyphs (emoji, CJK), can show a partial line. Browser floor for the fold: 1lh (Chrome 109, Safari 16.4, Firefox 120) and overflow: clip (Chrome 90, Safari 16, Firefox 81).

Focus entering clipped content expands the fold (see Focus behavior).

The themed recipe adds a fade over the last visible line while collapsed. The fade is on by default and removed under (prefers-reduced-transparency: reduce) and (forced-colors: active). It stays pinned to the viewport's visible inline extent during horizontal scroll and never covers the horizontal scrollbar.

Copy action ​

Activating the copy button (or calling the exposed copy()):

  1. calls useGhostClipboard().copy(copyText ?? code) synchronously from the activation handler;
  2. on success, sets the button's and the status region's data-state to copied and announces messages.copied. The visible button text does not change; the themed recipe paints a check mark from data-state with CSS (ADR 0013);
  3. on failure, sets data-state="failed", announces and shows messages.failed, and selects the rendered contents of <code>. While that fallback selection is active, the component listens for the native copy event on the owning document (element.ownerDocument), not on the code element: in a non-editable context the event targets the focused element, which is still the copy button, so it never passes through <code>. When the document selection still covers exactly the code contents, the listener sets the clipboard data to copyText ?? code (plain text) and prevents the default; otherwise it does nothing. So Ctrl+C after a failure copies the same text the button would have, without prompts, even on insecure origins where clipboardData is still writable. The listener is removed on the next copy(), when the selection changes away from the code, and on unmount;
  4. emits copySettled with { text, ok }.

The button stays enabled while a write is pending. A second activation supersedes the first (D4).

Themed recipe ​

recipes/code-block.css, in the zero-specificity ghostvue-theme layer:

  • Surface --ghost-surface-subtle-bg, text --ghost-text-default, border --ghost-border-hairline-width --ghost-border-default, radius --ghost-radius-md.
  • Code text --ghost-type-family-mono at --ghost-type-size-sm with the numeric --ghost-type-line-normal; tab-size: 2.
  • Header: muted text (--ghost-text-muted), --ghost-type-size-sm, a hairline separator, inset from --ghost-space-inset-* so density applies.
  • Copy button and fold toggle: quiet text buttons sized from --ghost-control-size-sm-* tokens (with the coarse-pointer floor), focus ring from --ghost-focus-ring-*. No default icon artwork; the copied state adds a CSS-painted check glyph beside the constant "Copy" text.
  • Status region while failed: visible text in --ghost-text-danger at --ghost-type-size-sm, laid out under the header.
  • Viewport padding from --ghost-space-inset-md; scrollbar clearance per the GhostScrollArea recipe.
  • Collapsed fade from --ghost-surface-subtle-bg to transparent.
  • Both color modes come from tokens; the recipe never branches on mode.

The themed wrapper uses the block div.ghost-themed-scope strategy documented in themed wrapper roots (the same strategy as GhostTable), and the build adds it to that table in docs/themes/default.md.

Prose styles ​

Scope ​

.ghost-prose is a class that styles the long-form HTML inside it. It ships in @ghostvue/themes as recipes/prose.css and in default.css. There is no component and no @ghostvue/vue export: prose is pure styling of the consumer's own elements (D9).

html
<article class="ghost-prose">
  <h1>Release notes</h1>
  <p>Install with <code>pnpm add @ghostvue/vue</code>.</p>
</article>

Scoping rules:

  • Every rule sits in @layer ghostvue-theme, and every complete selector is wrapped in :where() (including compound parts such as :where(code:not(pre code))), so it has zero specificity and any consumer rule, even a bare element selector, wins.
  • Element rules use @scope (.ghost-prose) to (.ghost-not-prose, [data-part]). Styling stops at any element with .ghost-not-prose and at any element carrying data-part, so a GhostCodeBlock, GhostTable, GhostLink, or GhostKbd inside an article keeps its own recipe instead of picking up prose rules. Every GhostVue component root carries data-part, and the build adds a test that enforces this for all exported components. Consumer or third-party markup with its own data-part attributes (other headless libraries, icon opt-ins) also stops prose; the documentation says so.
  • Scoping limits are not in scope themselves, so the element rules never reach an embedded component. Block spacing around embedded components comes from a separate, unscoped rule (see the table below).
  • A scoping root that itself matches a limit stays in scope. Putting .ghost-prose directly on a component part (for example <GhostCollapsibleContent class="ghost-prose">) or on an element inside that part restores prose there. This is the same behavior the generated token sheet relies on for @scope ([data-ghost-mode='light']) to ([data-ghost-mode]), and the build tests it.
  • @scope proximity ranks before source order in the cascade, so a scoped prose rule beats an unscoped zero-specificity recipe rule on any element it reaches. That is why the limit is needed at every component part (D11).
  • The scope sets no max-inline-size. Line length is the app's layout decision; the documentation shows max-inline-size: 70ch as a recipe.

Covered elements ​

ElementsTreatment
Scope root--ghost-type-family-sans, body size --ghost-type-size-lg, --ghost-type-line-normal, --ghost-text-default. First child has no block-start margin; last child has no block-end margin.
h1–h6Sizes 3xl, 2xl, xl, lg, lg, md; weight --ghost-type-weight-semibold; h1–h3 use --ghost-type-letter-tight and --ghost-type-line-tight; h4–h6 use --ghost-type-letter-normal and --ghost-type-line-snug; h6 in --ghost-text-muted. Block-start margin larger than block-end, so a heading binds to the text after it. scroll-margin-block-start: var(--ghost-prose-scroll-margin, 0) so an app with a sticky header sets one custom property.
p, ul, ol, dl, blockquote, pre, table, figure, hrVertical rhythm from --ghost-space-stack-*. Adjacent flow content is separated by --ghost-space-stack-md.
Embedded componentsDirect children of the prose root that are component roots ([data-part]) or block div.ghost-themed-scope wrappers, and component roots that are direct children of a display: contents span.ghost-themed-scope child, get the same --ghost-space-stack-md block spacing through a separate rule outside the @scope block. No other prose styling reaches them.
ul, ol, li, li::markerLogical-property indentation; nested lists tighten their spacing; markers in --ghost-text-muted; ol keeps native numbering and start / reversed. Task-list checkboxes (li > input[type=checkbox]) align with the first line.
dl, dt, dddt in --ghost-type-weight-semibold; dd indented by a logical inset.
a--ghost-text-primary, underlined with an offset, focus ring from --ghost-focus-ring-*. Visited links are not restyled.
strong, b, em, i, small, mark, abbr[title], sub, sup, del, insToken weights and colors only. mark uses --ghost-status-warning-bg with --ghost-status-warning-fg. abbr[title] keeps a dotted underline.
Inline code (not inside pre)--ghost-type-family-mono at 0.875em, --ghost-surface-muted-bg, --ghost-radius-sm, small inline padding, overflow-wrap: anywhere so long identifiers do not overflow narrow screens.
kbdMatches the themed GhostKbd look at sm size, for markdown output that cannot render the component.
Bare pre (and pre > code)The same surface, border, radius, padding, and mono type as the code block recipe, with overflow-x: auto and direction: ltr. No header, copy, or fold. A GhostCodeBlock inside prose is excluded by the [data-part] limit and keeps its own recipe.
blockquoteInline-start border in --ghost-border-strong, --ghost-text-muted, no quotation marks added.
hrHairline in --ghost-border-default with stack spacing.
table, thead, tbody, tfoot, tr, th, td, captionFull width of the content box, collapsed borders, row hairlines in --ghost-border-default, th in --ghost-type-weight-semibold with text-align: start, cell padding from --ghost-space-inset-sm, numeric columns not guessed, caption muted and at the block start. A wide table scrolls only if the consumer wraps it; the documentation shows a GhostScrollArea wrapper.
img, video, svg, figure, figcaptionMedia capped at max-inline-size: 100% with block-size: auto; figcaption muted at --ghost-type-size-sm.

The body size is --ghost-type-size-lg (15px by default), one step above the 14px component text, because long-form reading needs a larger size than dense controls; inline code at 0.875em is then about 13px.

Density and color modes ​

  • All spacing reads --ghost-space-stack-* and --ghost-space-inset-*, so data-ghost-density tightens or loosens the rhythm with no prose-specific switch. Dependency: app-builder feedback item B2 reports that data-ghost-density on a nested element currently has no effect (it works on <html>). Until that bug is fixed, density applies to prose only when set on <html>. The prose build tests density on <html>, and adds tests for density on the .ghost-prose element itself and on an intermediate ancestor that are marked as expected failures until the B2 fix lands, then turned on with it.
  • Body and heading sizes read --ghost-type-size-* and do not change with density, matching how density treats text elsewhere.
  • Colors read semantic tokens only, so data-ghost-mode, the system color scheme, and every theme from defineTheme apply without mode branches.
  • Forced colors: the token mapping already yields distinct system colors for text, links, and borders. No forced-colors block is added; inline code keeps its mono family as the distinguishing cue.
  • Right to left: every inset, indent, and border uses logical properties; bare pre stays left to right.

Token addition ​

--ghost-type-family-mono is a new semantic token (DTCG type.family.mono), default ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace. The code block recipe, prose inline code, bare pre, and prose kbd read it. defineTheme's fontFamily does not set it, because a theme that changes its text face rarely wants to change its code face; a consumer overrides the token on the palette host. The token reference and define-theme docs list it, and say that it is unrelated to the mono flagship theme (@ghostvue/themes/mono.css). Whichever build lands first adds the token; the other build rebases on it.

Environment behavior ​

SSR and hydration ​

  • Server markup is complete and deterministic: header, title, language, copy button with its text and name, an empty visually hidden status region, <pre>, <code> with the slot or escaped code, and the fold toggle with the fold styles when the fold is active and expanded resolves to false. Ids come from useGhostId, so they match on hydration.
  • The viewport renders without tabindex or role on the server and gets them after mount if it overflows, exactly as GhostScrollArea does. No hydration mismatch, because those attributes are added after hydration.
  • Whether the default slot is empty is decided from the rendered vnodes, the same way on the server and the client.
  • The copy button renders on the server even though the clipboard is unknown there, and stays visible on insecure origins. Hiding it after hydration would shift layout and remove the selection fallback, which is still useful (D2).
  • useGhostClipboard and writeClipboardText touch no browser API at setup.
  • Prose is CSS only. It renders identically on the server.

Mobile and touch ​

  • The viewport scrolls horizontally with touch; the page does not.
  • Copy and fold buttons meet the coarse-pointer minimum target through the --ghost-control-size-sm-* tokens and the @media (pointer: coarse) floor.
  • Long inline code in prose wraps with overflow-wrap: anywhere, so a phone never scrolls the page sideways for an identifier.
  • iOS Safari and Android Chrome support navigator.clipboard.writeText from a tap on a secure origin. The failure message names the device Copy menu, not only keyboard shortcuts. How an embedded webview presents the programmatic selection (handles, Copy menu) is a planned manual check, not a promise.

Performance ​

  • Expected scale: samples up to a few thousand lines, tens of blocks per page.
  • Line count is one pass over code, recomputed only when code changes.
  • Overflow measurement and the tab-stop rule use one ResizeObserver on the viewport and a subtree MutationObserver that re-runs hasTabbableDescendants over the slot markup when it changes, as GhostScrollArea does. A loadingdone listener on the document's FontFaceSet (where one exists, added after mount and removed on unmount) remeasures when a web font changes glyph widths without resizing either observed box. The development-only nested-<pre> check runs at the same moments and is removed from production builds. Nothing else walks the slot's DOM.
  • No highlighter, no worker, no virtualization. A consumer with very large samples folds them, or highlights only on demand.
  • Prose adds one stylesheet of zero-specificity rules and no JavaScript.
  • Bundle size: the build adds GhostCodeBlock to the bundle size budgets in scripts/bundle-size-budgets.json.

Composition ​

  • Viewport. useGhostScrollArea cannot be reused as is: its root props hard-code the ghost-scroll-area class, data-part="root", and an aria-label-only name, which would pull the scroll-area recipe onto the <pre> and drop the aria-labelledby rule. The code block reuses the internal helpers measureScrollOverflow and hasTabbableDescendants with the same observer setup, and builds its own viewportProps (data-partviewport, data-overflow, the tab-stop rule, and the naming rule above). If the build extracts a shared internal helper from useGhostScrollArea, GhostScrollArea's public output must not change.
  • useControllableState owns expanded.
  • useGhostId owns ids.
  • useGhostClipboard is used by the code block and is public for any other copy control (a "copy invite link" button, a token field).
  • The GhostVisuallyHidden inline styles hide the status region while it is idle or copied.
  • GhostCollapsible is not reused for the fold. A collapsible hides its whole panel; the fold clips part of one, keeps all of it available to assistive technology, and its toggle sits after the content it affects (D8).
  • GhostButton is not rendered inside the headless component, which stays dependency-free in markup. The themed recipe matches the quiet button look through shared tokens.

Docs site adoption ​

The docs site adopts the clipboard helper in the code block build:

  • DemoPreview.vue replaces its local copy state, request counter, and copyToClipboard with useGhostClipboard, keeping its own selection fallback and its visible failure text.
  • enhance-code-fences.ts replaces copyToClipboard with writeClipboardText. VitePress keeps rendering markdown fences, so the fences do not become GhostCodeBlock.
  • The local copyToClipboard helper is deleted.

The example source strip in DemoPreview is a candidate for GhostCodeBlock later. It is not part of this contract. The docs site does not adopt .ghost-prose: VitePress's .vp-doc styles own its articles, and swapping them would be a docs redesign.

Test plan ​

Unit tests (framework-neutral and composable) ​

  • writeClipboardText: resolves true on success; false with no navigator, with no navigator.clipboard, and when writeText rejects; never rejects; calls writeText synchronously (before the returned promise is awaited); passes the text through unchanged, including ''.
  • useGhostClipboard: copied then idle after copiedDuration (fake timers); failed persists; reset() clears state, timer, and text; non-positive and non-finite copiedDuration keep copied; announcement key increments on equal consecutive texts; a slow first write that settles after a fast second write changes nothing; disposal clears the timer and ignores late settles; messages are read at settle time; writeText is called in the same tick as copy(); works inside a bare effectScope with no component.
  • Line counting: '' and '\n' are 0, 'a' and 'a\n' are 1, 'a\n\nb' is 3, 'a\r\nb' is 2, and 'a\n\n' is 2.

Vue component tests ​

  • Renders the plain code escaped when the default slot is absent, and when it renders only a comment (v-if false) or whitespace (an HTML string in code appears as text).
  • Renders slot markup inside <code data-part="code"> unchanged; <code> has translate="no" and language-<language> when language is set.
  • Development warning when the slot contains a <pre>.
  • Header presence matrix: renders when any of title, title slot, language, actions, or copyable; absent when none apply.
  • Language label is exposed with and without a title.
  • Copy button name follows copyLabel(title) and visible text stays messages.copy across idle, copied, and failed; the name contains the visible text in every state (label in name); the copy slot replaces the visible content and keeps the name.
  • Status region renders whenever the header renders, including with copyable set to false; carries data-state; has the visually hidden inline styles while idle or copied and none while failed.
  • copyable=false with a custom copy button in actions calling the slot's copy() announces success and failure.
  • copyText overrides what is written; copySettled emits { text, ok } for the latest request only; @copy on the component still receives the native DOM event.
  • Region naming: aria-labelledby the title element with the title prop, with only the title slot, and aria-label from regionLabel(language) without either.
  • Fold: inactive when foldLines is unset, when the sample fits, or when foldLines is invalid (with the development warning); display: block and the custom property in both states while active; collapsed styles only when collapsed; no inline styles when inactive; no aria-expanded or aria-controls on the toggle; controlled and uncontrolled expanded; defaultExpanded; state kept when code shrinks below the fold and grows back.
  • Focus entering a link inside <code> while collapsed expands in uncontrolled mode and only emits in controlled mode.
  • Failure path selects the contents of <code>; a native copy event dispatched on the copy button (where focus stays) while that selection is active receives copyText ?? code; a copy event with a different selection is left alone; the document listener is gone after the selection changes, after the next copy, and after unmount.
  • Exposed copy() matches the button; element is null before mount.
  • Viewport carries dir="ltr"; attribute fallthrough to the root; ids are stable and unique per instance.
  • SSR: renderToString output contains the status region, no tabindex on the viewport, and the fold styles; hydration produces no mismatch warnings for an empty slot, a filled slot, and an active fold.

Browser tests (Playwright, tests/e2e/ghost-code-block.spec.ts) ​

  • Chromium: copy with clipboard permission granted writes the text (read back with navigator.clipboard.readText), announces through the status region, keeps "Copy" as the visible text, and returns to idle.
  • WebKit and Firefox: an init script replaces navigator.clipboard.writeText with a recording stub; tests assert the call arguments, that the call happened inside the click handler, and the resulting states. A rejecting stub covers the denied-permission and cross-origin-frame failures.
  • Copy with the Clipboard API removed (init script) announces and shows the failure, selects the code, keeps focus on the button, and Ctrl+C / ⌘C then puts copyText ?? code on the clipboard (Chromium read-back).
  • A cross-origin <iframe> without allow="clipboard-write" hosting a code block reaches the failure path.
  • Two rapid copies with a delayed first write end in the second result.
  • A long-line sample: the viewport becomes a named tab stop, arrow keys scroll it, the page does not scroll horizontally at 320 px wide.
  • A sample with a link in the slot: the viewport is not a tab stop; with the fold collapsed and the link on a clipped line, tabbing to the link expands the fold and the link is visible.
  • Fold: themed collapsed height equals foldLines lines; toggle expands and collapses; after collapsing a tall sample the toggle is in view; horizontal scroll still works while collapsed and the fade stays in place; clipped lines are present in the DOM.
  • RTL: on a dir="rtl" page, code renders left to right and the header follows the page.
  • Prose: a fixture article with every covered element renders the specified tokens in light and dark mode and at compact, comfortable, and spacious density on <html> (nested density tests per Density and color modes); a GhostCodeBlock, GhostTable, and .ghost-not-prose block inside the article do not receive prose rules but do get block spacing from the paragraphs around them; .ghost-prose placed directly on a component part, and on an element inside one, restores prose; a consumer's bare element selector (h2 { … }) overrides the prose rule; long inline code wraps at 320 px; logical properties mirror on a dir="rtl" article.
  • Every exported component root renders a data-part attribute (the prerequisite for the prose limit).

Accessibility and keyboard tests ​

  • Axe passes on collapsed, expanded, overflowing, copied, and failed states, in both color modes, and on the prose fixture.
  • Tab order matches the keyboard table.
  • Forced colors: copy and fold buttons keep a visible boundary; the fold fade is removed (extend tests/e2e/forced-colors-visual.spec.ts).
  • Keyboard evidence recorded per pnpm keyboard:evidence conventions for the copy button, viewport, and fold toggle.

Planned manual assistive-technology checks ​

Recorded before the manifest is promoted past experimental, per the assistive-technology review process:

  • NVDA + Firefox and VoiceOver + Safari: "Copied" re-announces on a repeated copy; the failure message is read once; the fold toggle reads as a plain button; the named region is announced only for overflowing samples.
  • One voice-control pass (Voice Control on macOS or Dragon): "click Copy" works in every state.
  • iOS Safari and one Android webview: the failure fallback's selection is visible and copyable from the system menu.

Type tests ​

  • GhostCodeBlock requires code; expanded is boolean | undefined; messages accepts a partial object with function-valued copyLabel, regionLabel, and expand; slot props are typed (state is GhostClipboardState); the copySettled payload is GhostCodeBlockCopySettledEvent.
  • useGhostClipboard accepts refs and getters for its options; state and announcement are readonly.
  • Themed and headless GhostCodeBlock props are assignable to each other.

Regression fixtures ​

  • The three supported highlighter outputs from the content model (Shiki structure: 'inline', Prism, highlight.js), so a recipe change cannot break any of them.

Documentation plan ​

  • docs/components/code-block.md: purpose, the plain and highlighted examples, the supported recipe for each highlighter (and why Shiki's default codeToHtml output does not fit), a Shiki dual-theme example that follows data-ghost-mode, a shell sample with copyText, a folded sample with the find-in-page limitation, an icon copy button through the copy slot, an actions slot link and a custom copy button, the generated props, events, slots, and hooks tables, accessibility notes (the fold is visual only; the failure fallback; copy must run inside the user's click), and the v-html trust note.
  • A clipboard section on the same page for useGhostClipboard and writeClipboardText, with a standalone "copy invite link" example that renders the announcement in GhostVisuallyHidden.
  • A prose page under docs/themes/ (the prose build names it): the class, the covered elements, .ghost-not-prose, the [data-part] limit (including third-party data-part), nesting on and inside component parts, spacing around embedded components, density and modes (with the current B2 limitation), line length, --ghost-prose-scroll-margin, the --ghost-type-family-mono override, and a wide-table GhostScrollArea wrapper.
  • Token reference and define-theme docs list --ghost-type-family-mono and distinguish it from the mono theme.
  • The themed wrapper strategy table in docs/themes/default.md lists GhostCodeBlock under the block div strategy.
  • Typed executable examples under examples/code-block/ and the prose example directory, rendered with <GhostExample>, plus playground coverage.

Compatibility and release impact ​

  • All additive: new exports in @ghostvue/vue and @ghostvue/themes, two new recipe files, two new classes, one documented custom property, and one new semantic token. Nothing existing changes behavior.
  • default.css grows by the two recipes. Apps on the opt-in recipe path are unaffected until they import recipes/code-block.css or recipes/prose.css.
  • .ghost-prose styles only descendants of an element that carries the class, plus block spacing on its direct children, so no existing page changes.
  • If the build extracts a shared helper from useGhostScrollArea, GhostScrollArea output stays identical; its existing tests must pass unchanged.
  • The new manifests start at experimental.
  • Changesets: minor for @ghostvue/vue and @ghostvue/themes in each build.
  • Docs site: deleting its local copyToClipboard is internal to the docs app.

Design decisions ​

  • D1. Ship all three together, as two builds. The clipboard helper and the code block ship in one build because the code block is the helper's first consumer and the docs site adopts both. Prose ships in a parallel build because it is CSS only and shares nothing but the mono token. None of the three stays a recipe-only documentation page: the feedback shows each app rebuilding all three.
  • D2. No execCommand fallback. document.execCommand('copy') is deprecated, needs a temporary focused textarea that steals focus and can scroll the page, and fails in the same embedded contexts where the Clipboard API is missing. Selecting the code, showing a visible message, and supplying the right text to the native copy event keeps the reader in control and works everywhere. The copy button stays visible on insecure origins for the same reason.
  • D3. Highlighted markup goes in the default slot; no html prop. A string-HTML prop would put v-html inside the library and make every consumer's highlighter output an XSS surface GhostVue appears to own. The slot keeps the trust decision visible in the consumer's template, and it accepts token-based renderers (Shiki codeToTokens) as well as HTML strings. The content model says exactly what fits.
  • D4. Latest request wins. Overlapping writes settle in any order. Only the latest one changes state, announces, emits, or selects text. Matches the docs site's current behavior.
  • D5. Copy writes props, not DOM text. Reading textContent from the slot would copy diff markers, prompts, and line-number gutters a highlighter renders. code (or copyText) is the single source of truth, including for the native copy event after a failure.
  • D6. The root is a <div>, not a <figure>. A figure would need a figcaption to be named, and the only caption candidate is the title, which already names the scrollable region where a name is useful. A code sample is not a figure the article refers to, so the extra grouping adds noise.
  • D7. Constant copy button name and constant visible text. Changing the name to "Copied" under the pointer or focus is announced inconsistently and breaks voice control. Changing only the visible text would break label in name for the copied period. So both stay; success is shown with data-state and announced through the live region.
  • D8. The fold clips visually, has no disclosure state, and does not reuse GhostCollapsible. A collapsed sample still shows its first lines, so hiding the panel is wrong. Removing lines from the DOM would require parsing consumer markup. Clipping keeps every line available to screen readers and the failure fallback, so aria-expanded would misstate the content. Focus entering clipped content expands the fold.
  • D9. Prose is a class, not a data-ghost-* attribute. The existing data-ghost-theme, data-ghost-mode, and data-ghost-density attributes set token values that nest and inherit. Prose instead applies element styles to a subtree, which is what the existing .ghost-theme class does. A class also matches what consumers expect from other prose utilities, and it is easy to add from markdown renderers.
  • D10. A mono family token. Components consume semantic tokens only, and there is no monospace token today. One token serves the code block, inline code, bare pre, and kbd in prose. defineTheme does not set it in this release.
  • D11. Prose stops at component parts. @scope proximity would otherwise let prose rules beat component recipes on every element inside an article, regardless of source order. The [data-part] limit keeps components on their own recipes, a separate rule gives them block spacing, and putting the class on or inside a part restores prose where it is wanted.
  • D12. writeClipboardText is public. Non-component code (the docs site's fence enhancer, a consumer's directive) needs the same failure contract without a Vue scope. It is the one non-useGhost* function in this spec, following the precedent of defineDataTableColumns.

Open architectural questions ​

None. D1–D12 are approved with the rest of the specification.

Approval ​

zprue743 approved this specification on 2026-12-01, on condition that every change recommended by an independent review of the first draft was applied. All recommended changes were applied before approval, including the two choices the review left open: the prose body uses --ghost-type-size-lg, and untitled overflowing samples keep the GhostScrollArea region rule with the language in the fallback name. Recorded in PR #705.

This is design approval only. It is not merge approval of any implementation or a release inclusion decision.