Skip to content

feat(design): align documentation with the shared semantic theme - #342

Merged
abrichr merged 4 commits into
mainfrom
codex/unified-semantic-theme
Nov 21, 2026
Merged

abrichr merged 4 commits into
mainfrom
codex/unified-semantic-theme

Conversation

@abrichr

@abrichr abrichr commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Material’s light and dark schemes now use the shared OpenAdapt theme for navigation, actions, and typography. The documentation homepage keeps its current layout. Its links, text and card borders follow the selected scheme, including on a phone.

The shared producer shipped in web #636. The documentation package is byte-identical to the nine-file pack in Desktop #2305, including its provenance and both font licenses. The Desktop release owner plans to ship that change through #2314.

Git previously converted eleven of thirteen files across the two vendored snapshots when a checkout enabled CRLF conversion. The PR preserves the committed bytes for both snapshots and tests actual Git checkouts with conversion enabled and disabled.

Verification

  • Parent docs CI passed 616 tests and 23 subtests, with four skips. The strict MkDocs build passed.
  • All seven upstream CSS, JSON, font and license source blobs match the published producer at 2cf4a3c3. The generated font sheet and complete provenance manifest also match the Desktop snapshot.
  • Headless Chromium rendered the built homepage at widths of 390 and 1280 pixels in both Material schemes. All four combinations loaded Public Sans and Inter Tight, had zero horizontal overflow, and matched the shared colors for links, heading text, action foreground and background, and card borders.

Response to the independent review

At 8123f29, headings, outline buttons, grid cards, and the footer use the selected scheme in slate. The HTML root follows the scheme set on the body. The search and hover treatment remains visible against the light canvas. Vendor bytes are unchanged.

A before-and-after Chromium check on the built homepage and quickstart found 22 mismatches in 36 comparisons on 2341360 and zero on the fix. It exercised the real pointer hover on a homepage card and on an outline button, along with the root scheme, search, headings, and footer. The outline button and Material card grid were inserted into the quickstart article for the component checks. The four current homepage renders also loaded both font faces without overflow at 390 and 1280 pixels. A permanent headless Chromium test loads Material’s CSS and the project stylesheets in their configured order. Ten focused tests passed locally, and the strict build passed. Current CI · Review findings.

The original branch’s sixteen cross-surface browser cases are historical. The four homepage cases above cover the current merge with the homepage redesign.

Generality

  1. This change touches documentation styles and build tests. There is no per-app engine code.
  2. Shared semantic roles cover layout-independent presentation across surfaces. One checkout rule preserves the bytes of both vendored generations.
  3. Material and the responsive documentation homepage exercise the contract independently of Desktop. The evidence covers presentation and checkout behavior.

Consistent action and outcome colors help readers distinguish navigation from a verified result.

@abrichr
abrichr marked this pull request as ready for review November 20, 2026 23:30
@abrichr

abrichr commented Nov 20, 2026

Copy link
Copy Markdown
Member Author

Independent Grok review

Reviewed-Head: 2341360

REQUEST CHANGES. The snapshot, licenses, and navigation custom properties hold. Dark-mode paint, the root color scheme, and the light-mode wash alias do not.

I did not run git, hash the files, build the site, or drive a browser. The internal sha256 pin and the autocrlf checkout test are taken from CI on 2341360f (Validate canonical docs, 616 tests passed, strict MkDocs build). Upstream byte identity with website f50e9c14 / 2cf4a3c3 and Desktop PR 2305 at ab963290 is the operator’s comparison. The four Chromium runs are the owner’s, on the built home page only.

What holds:

The vendored semantic-theme.css matches semantic-theme.json for common, dark, and light. Provenance lists both OFL files, both woff2 files, and SOURCES.md. .gitattributes marks docs/stylesheets/vendor/** as -text, and test_checkout_preserves_both_vendor_snapshots covers that tree with core.autocrlf true and false.

With the mkdocs.yml order (brand.css, then the vendored sheet, then docs/stylesheets/semantic-theme.css), these equal-specificity (0, 1, 0) assignments on [data-md-color-scheme] win over [data-md-color-scheme="default"] and [data-md-color-scheme="slate"] in brand.css: --oa-accent, --md-typeset-a-color, and --md-accent-fg-color all become var(--oa-link). The slate assignments --oa-accent: var(--inset-ok) and --md-typeset-a-color: var(--inset-ok) are dead. --oa-link and --oa-verified differ in both themes (#79adff / #3ad69f, #1f4fbf / #0b7a5a). Primary buttons lose the tie to [data-md-color-scheme] .md-typeset .md-button--primary in docs/stylesheets/semantic-theme.css, which matches the owner’s --oa-action / --oa-on-action probes. Removing the slate .oa-docs-home inset block in home.css is what lets those home probes pass.

Blockers:

  1. Dark chrome still paints the old inset palette. tokens.css is unchanged, and nothing later overrides these direct declarations in docs/stylesheets/brand.css:

    • [data-md-color-scheme="slate"] .md-typeset h1 sets color: var(--inset-text) at (0, 2, 1). That beats .md-typeset h1 (color: var(--oa-ink)). Home’s later rule colors only :is(h2, h3) and a.oa-docs-path strong with --oa-home-ink. The home title in slate stays on --inset-text. The owner’s script reads an h2.
    • [data-md-color-scheme="slate"] .md-typeset .md-button sets border-color and color to var(--inset-text). The new primary rule does not match outline buttons.
    • [data-md-color-scheme="slate"] .md-typeset .grid.cards > ul > li sets border-color: var(--inset-border) and background: var(--inset-raised) at (0, 4, 2), so the new --oa-hairline / --oa-panel card rule does not apply. Radius does change, via --docs-radius-card.
    • [data-md-color-scheme="slate"] .md-footer and [data-md-color-scheme="slate"] .md-footer-meta set background: color-mix(in srgb, var(--inset-bg) 80%, black).

    The page canvas, header, links, and primary buttons switch to the semantic hexes. These surfaces do not. Same fix class: point those declarations at --oa-text, --oa-border, --oa-surface-raised, and --oa-canvas / --oa-surface, or drop the slate declarations so the remapped aliases apply.

  2. Light pages keep a dark root. In docs/stylesheets/vendor/semantic-theme/semantic-theme.css, bare :root is grouped with [data-md-color-scheme="slate"] and sets color-scheme: dark plus the dark hexes. MkDocs puts data-md-color-scheme on body, not html. Body then matches [data-md-color-scheme="default"] and fixes custom properties for descendants. color-scheme on the root still drives the canvas and viewport scrollbars, so a light document keeps dark UA chrome and a dark overscroll canvas. The vendored file is hash-pinned, so the override belongs in docs/stylesheets/semantic-theme.css, for example html:has([data-md-color-scheme="default"]) { color-scheme: light } and the slate counterpart. Do not fork the snapshot.

  3. The wash alias is a no-op in light mode. docs/stylesheets/semantic-theme.css sets --oa-ink-wash: var(--oa-surface-raised). In the light contract, --oa-surface-raised and --oa-canvas are both #ffffff. These backgrounds therefore match the page: [data-md-color-scheme="default"] .md-search__form, [data-md-color-scheme="default"] .md-typeset .md-button:hover, .md-typeset .oa-docs-home .oa-docs-start, and .md-typeset .oa-docs-home a.oa-docs-path:hover. Map the wash to a translucent mix of --oa-text, or to --oa-surface (#f5f7fa), which is the raised step that is actually distinct from the canvas.

Coverage: test_navigation_does_not_use_the_verified_outcome_color is a string search for two declarations in the adapter. It never checks load order, computed winners, or the slate selectors above, so it stays green with this cascade. It also never checks --oa-action or --oa-focus against --oa-verified. The checkout test is the class-wide check, and it is aimed at the right tree. The required manifest list omits the woff2 files and fonts/SOURCES.md, but this commit’s provenance.json still hashes them. The browser script is the home page the adapter was written against: kicker, h2, primary button, path border, font names, overflow. It is not a held-out page. Nav, h1, outline buttons, grid cards, footer, search, and color-scheme on documentElement were not measured. The lead looked at default-1280 only. Font loading from the built site is the owner’s localhost run, with non-local requests aborted.

The pin, OFL files, and link-versus-verified variable split can land. The three selector bugs above are the merge block.

@abrichr

abrichr commented Nov 20, 2026

Copy link
Copy Markdown
Member Author

Independent Grok follow-up review

Reviewed-Head: 8123f29

APPROVE. The three blockers are fixed in the cascade, and nothing in this diff reopens them.

Residual slate paint is gone. brand.css deletes the slate h1 color, the slate outline and primary button rules, and the slate .grid.cards > ul > li inset background and border. The resting outline button now comes from .md-typeset .md-button (border: 0.075rem solid var(--oa-ink)) plus [data-md-color-scheme] .md-typeset .md-button { color: var(--oa-ink) }. --oa-ink still resolves to --oa-text. Primary buttons stay on the later equal-specificity rules in docs/stylesheets/semantic-theme.css (--oa-action / --oa-on-action). Cards fall through to border: 1px solid var(--oa-hairline) and background: var(--oa-panel). The slate footer uses background: var(--oa-ground) (canvas). The slate footer meta uses background: var(--md-footer-bg-color), and that variable still loses the tie to the later [data-md-color-scheme] assignment var(--oa-surface). The light footer meta is unchanged: --oa-panel, which is surface-raised.

Root scheme is overridden on the element that owns the viewport. html:has(> body[data-md-color-scheme="default"]) and the slate twin set color-scheme to light and dark. Specificity is (0, 1, 2), which beats the vendored :root { color-scheme: dark } at (0, 1, 0). Material still puts the attribute on body, and body is a direct child of html. The vendored file is untouched.

The light wash is no longer the canvas. --oa-ink-wash is now var(--oa-surface). In the light contract that is #f5f7fa against canvas #ffffff. In the dark contract it is #0a0f17 against #05080d. Search, .oa-docs-start, outline hover, and a.oa-docs-path:hover all read that variable. Outline hover is [data-md-color-scheme] .md-typeset .md-button:hover; the primary hover rule remains later at the same specificity, so it still uses --oa-action-hover.

I did not run the fixture, the browser script, or CI 44839810059. The earlier green run was the previous head. The new test renders Material plus the real extra_css order and checks these roles in both schemes, but it skips when Chrome is missing and it does not apply :hover. The 36/36 result is the owner’s measurement on a built home page and quickstart: the outline button and grid card were inserted into the quickstart article, and the run included root color-scheme, pointer hover, and the wash-versus-canvas check. That measurement matches the corrected selectors.

@abrichr
abrichr merged commit b0f6808 into main Nov 21, 2026
10 checks passed
@abrichr
abrichr deleted the codex/unified-semantic-theme branch November 21, 2026 04:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant