Skip to content

docs: migrate docs and blog to Primer with Squad branding, hub blog, and accessibility sweep - #2447

Open
IEvangelist wants to merge 27 commits into
github:devfrom
IEvangelist:ievangelist-primer-docs-blog-refactor
Open

IEvangelist wants to merge 27 commits into
github:devfrom
IEvangelist:ievangelist-primer-docs-blog-refactor

Conversation

@IEvangelist

@IEvangelist IEvangelist commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

What

Migrates the docs and blog front end from Tailwind and a custom theme to Primer (@primer/css + @primer/primitives), then layers a Squad brand skin (rose/teal on navy ink, Mona Sans, framed dotted-rail layout) on top of Primer tokens. Adds a hub-style filterable blog, a redesigned site search dialog, collapsible docs sidebar, hierarchical breadcrumbs, and a broad accessibility test sweep. Includes a npm run screenshots CLI that captures every layout on mobile/tablet/desktop in light and dark mode.

Why

The docs and blog used a fully custom Tailwind theme. Moving to Primer gives accessible components and tokens, light/dark via data-color-mode, and a maintainable base, while keeping Squad's identity. Verified for functionality, usability and accessibility (axe WCAG 2.2 AA + best practices).

How

  • Theming: Primer tokens + data-color-mode (auto by default, localStorage override), no flash across view transitions. Brand overrides live in docs/src/styles/brand.css/site.css/blog.css, token-based only.
  • Blog: hub layout (search, latest cells, category/author filters, custom sort and page-size dropdowns, pagination, URL-synced state, empty state), article layout with active TOC.
  • Docs: collapsible sidebar (only the current section open, current page scrolled into view), breadcrumbs derived from the sidebar (omitted for root pages), pager spans full width with one link.
  • Search: native <dialog> with blur backdrop, scroll lock, grouped results, arrow-key navigation, clear button, single-Esc close.
  • Accessibility: contrast raised, 24px target sizes, unique landmarks, focusable scrollable tables, labelled task-list checkboxes, hidden H1 where markdown has none (rehype-a11y plugin). tests/a11y*.spec.mjs run axe over a sample of built pages, interactive states and mobile.
  • Fixes found during QA: docs package-lock.json resolved entries to an internal feed (rewritten to registry.npmjs.org + sha512); search state reset on quick reopen; regenerated docs/.astro schemas; relaxed test/docs-build.test.ts table assertion for focusable tables.
  • Merged dev (lockfile conflict resolved by regenerating against the public registry).

⚠️ Quick Check

  • No SDK/CLI source files changed, so no changeset is needed (.changeset not required; docs-only)

PR Readiness Checklist

Branch & Commit

  • Branch created from dev; dev merged in (merge commit, no force-push)
  • Diff reviewed: changes are limited to docs/ and test/docs-build.test.ts (plus the merge of dev)
  • PR is not in draft mode
  • Commit history is clean (several iterative commits; recommend squash merge)

Build & Test

  • cd docs && npm run build passes (778 pages incl. generated API reference; Pagefind indexed)
  • cd docs && npm test passes: 13 build-output tests + 71 Playwright tests (requires npm run docs:api and astro preview --port 4321)
  • npx vitest run test/docs-build.test.ts test/docs-links.test.ts test/docs-site-location.test.ts test/release-lockfile-registry.test.ts passes (release-lockfile-registry has a 5s timeout that can flake under CPU load when run in parallel; passes alone)
  • Root npm run lint / lint:eslint not run (no SDK/CLI changes)

Changeset

  • N/A. Docs only (packages/*/src untouched)

Docs

  • docs/README.md updated (styling, accessibility tests, screenshot CLI)

Exports

  • N/A

Visual review

Full gallery (76 captures: mobile 390, tablet 820, desktop 1440, light and dark) is generated locally: cd docs && npm run build && npm run screenshots then open docs/visual-review/index.html. Highlights:

Landing page

Light Dark
Landing page, desktop, light Landing page, desktop, dark

Blog hub

Light Dark
Blog index, desktop, light Blog index, desktop, dark

Blog post and empty search state

Post (dark) Empty search (dark)
Blog post, desktop, dark Blog empty search, desktop, dark

Docs page (sidebar, breadcrumb, table of contents, pager)

Light Dark
Docs page, desktop, light Docs page, desktop, dark

Site search

Search dialog with results, desktop, dark

Tablet and mobile

Blog index, tablet, light Landing, mobile, dark Docs drawer, mobile, dark
Blog index, tablet, light Landing page, mobile, dark Docs sidebar drawer, mobile, dark

Review feedback addressed

Copilot review items fixed in aa54eb9: JSON-LD output is escaped (no < can close the script element), the non-docs hamburger uses the breakpoint where its menu is visible, stale search failures and options are ignored or cleared while typing, previously open dropdown triggers reset, pagination keeps keyboard focus, the result-count live region stays in the accessibility tree on small screens, and the blog lead blockquote is only dropped when it duplicates the hero (the archive notice on the Wave 2 post is kept). Each has a regression test in docs/tests/a11y.spec.mjs.

Known, pre-existing (not changed here)

  • 44 broken internal links and 3 broken #anchors in docs content (e.g. relative first-session link, /features/... links missing the site base). Out of scope; happy to fix in a follow-up.
  • A few light-mode syntax-highlight colours meet 4.5:1 but not the stricter 7:1.

Breaking Changes

None. The look of the docs/blog changes intentionally; URLs, content and Pagefind selectors are unchanged.

Waivers

None.

IEvangelist and others added 21 commits November 9, 2026 08:18
Replace Tailwind and the custom pink/navy theme with @primer/css and
@primer/primitives. Theme via data-color-mode, add an accessible search
dialog and sidebar drawer, switch Shiki to high-contrast themes, and add
axe-core WCAG A/AA, theme, keyboard and mobile e2e checks.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Layer a Squad brand skin over Primer tokens (rose/teal on navy ink, Mona
Sans, framed dotted-rail layout, grid and grain texture, glows, spotlight
cards, reading progress). Rebuild the landing page, add a filterable
hub-style blog with featured cells and article layout, and polish docs
with breadcrumbs, active TOC and pager.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Branded dialog with blurred backdrop, suggestions, section glyphs and
paths, highlighted excerpts, arrow-key navigation and key hints.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Custom sort and page-size dropdowns, square checkbox filters, hub chips,
and lighter 22px card titles modelled on awesome-copilot's learning hub.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…; hub pagination; remove footer gap

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
… root scrollbar contrast

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ssibility sweep and contrast fixes

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ktop layout

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ma and test updates

- Rewrite five docs/package-lock.json entries from an internal feed to
  registry.npmjs.org with sha512 integrity (release-lockfile-registry gate)
- Reset search state synchronously on close/cancel so reopening quickly
  does not drop or keep typed text
- Commit regenerated .astro collection schemas (blog hero/wave fields)
- Relax docs-build table assertion for focusable scrollable tables

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
npm run screenshots captures every layout page on mobile, tablet and
desktop in light and dark mode and writes an HTML gallery.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…cked files

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI auto review requested due to automatic review settings November 9, 2026 18:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unescaped frontmatter titles in JSON-LD can allow script injection on the docs origin, alongside unresolved search, navigation, and accessibility regressions.

8 open issues
1 file not reviewed
  • docs/package-lock.json: Generated file
What changed in this PR

Migrates Squad’s Astro docs and blog from Tailwind to Primer, retaining Squad branding while adding richer navigation, search, and accessibility support.

Changes:

  • Introduces Primer-based styling, brand tokens, Mona Sans typography, and persistent light/dark themes.
  • Adds a filterable blog hub, hierarchical breadcrumbs, collapsible docs navigation, and keyboard-enabled search.
  • Expands accessibility and interaction tests, adds markdown accessibility transforms, and provides a screenshot gallery CLI.
File Description
test/​docs-build.test.ts Allows attributes on rendered tables.
docs/​tests/​sidebar.spec.mjs Tests section collapsing and current-page visibility.
docs/​tests/​search.spec.mjs Updates search assertions for the redesigned dialog.
docs/​tests/​search-keyboard.spec.mjs Covers keyboard navigation, clearing, reopening, and scroll locking.
docs/​tests/​blog.spec.mjs Tests blog filtering, sorting, pagination, and article navigation.
docs/​tests/​a11y.spec.mjs Adds accessibility, theme, mobile, and breadcrumb checks.
docs/​tests/​a11y-sweep.spec.mjs Checks sampled pages and interactive states with axe.
docs/​src/​styles/​site.css Adds Primer-based site layout and content styles.
docs/​src/​styles/​global.css Removes the Tailwind theme and utilities.
docs/​src/​styles/​brand.css Adds Squad branding, visual effects, and component styling.
docs/​src/​styles/​blog.css Styles the blog hub, controls, cards, and articles.
docs/​src/​plugins/​rehype-a11y.mjs Adds markdown table, checkbox, and heading accessibility transforms.
docs/​src/​pages/​blog/​index.astro Implements the searchable, filterable, paginated blog hub.
docs/​src/​pages/​blog/​[...slug].astro Adds article metadata, breadcrumbs, and a table of contents.
docs/​src/​pages/​404.astro Migrates the error page to Primer styling.
docs/​src/​lib/​breadcrumbs.ts Derives docs breadcrumbs from navigation data.
docs/​src/​lib/​blog.ts Shares blog categorization and formatting helpers.
docs/​src/​layouts/​DocsLayout.astro Integrates breadcrumbs, Primer layout, and redesigned paging.
docs/​src/​layouts/​BaseLayout.astro Loads styles and fonts; updates theming and shared enhancements.
docs/​src/​content.config.ts Adds optional blog hero and wave metadata.
docs/​src/​components/​ThemeToggle.astro Switches Primer color modes and updates accessible labels.
docs/​src/​components/​TableOfContents.astro Highlights the article section currently in view.
docs/​src/​components/​Sidebar.astro Adds collapsible sections and current-page centering.
docs/​src/​components/​Search.astro Implements native-dialog search with grouped results and keyboard controls.
docs/​src/​components/​Icon.astro Provides shared decorative Octicons.
docs/​src/​components/​Header.astro Updates responsive navigation and drawer controls.
docs/​src/​components/​Footer.astro Uses structured navigation columns and build metadata.
docs/​src/​components/​Breadcrumbs.astro Renders breadcrumb navigation and structured data.
docs/​scripts/​capture-screenshots.mjs Captures responsive themed screenshots and generates a gallery.
docs/​README.md Documents Primer styling, accessibility tests, and screenshots.
docs/​package.json Replaces Tailwind dependencies and adds accessibility tooling.
docs/​astro.config.mjs Registers accessibility transforms and high-contrast code themes.
docs/​.gitignore Ignores screenshots and test results.
docs/​.astro/​content.d.ts Refreshes the generated content configuration import path.
docs/​.astro/​collections/​blog.schema.json Reflects the new blog metadata fields.

Review effort: Balanced (auto)

Comment thread docs/src/components/Breadcrumbs.astro Resolved
Comment thread docs/src/components/Header.astro Resolved
Comment thread docs/src/components/Search.astro Resolved
Comment thread docs/src/components/Search.astro Resolved
Comment thread docs/src/pages/blog/index.astro Resolved
Comment thread docs/src/pages/blog/index.astro Resolved
Comment thread docs/src/styles/blog.css Resolved
Comment thread docs/src/styles/brand.css Resolved
IEvangelist and others added 2 commits November 9, 2026 13:04
- Escape JSON-LD output so titles cannot close the script element
- Hamburger breakpoint matches the menu it opens on non-docs pages
- Search: ignore stale failures and drop stale options while typing
- Dropdowns reset the previously open trigger state
- Pagination keeps keyboard focus after rebuild
- Result count live region stays in the accessibility tree on small screens
- Only drop the blog lead blockquote when it duplicates the hero

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@bradygaster

Copy link
Copy Markdown
Collaborator

holy cow. thank you, @IEvangelist!!!! this is amazing. cc @tamirdresher

IEvangelist and others added 2 commits November 9, 2026 14:35
… hover layout shift)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

🟠 Impact Analysis — PR #2447

Risk tier: 🟠 HIGH

📊 Summary

Metric Count
Files changed 37
Files added 13
Files modified 23
Files deleted 1
Modules touched 2
Critical files 1

🎯 Risk Factors

  • 37 files changed (21-50 → HIGH)
  • 2 modules touched (2-4 → MEDIUM)
  • 1 file(s) deleted
  • Critical files touched: docs/package.json

📦 Modules Affected

docs (36 files)
  • docs/.astro/collections/blog.schema.json
  • docs/.astro/content.d.ts
  • docs/.gitignore
  • docs/README.md
  • docs/astro.config.mjs
  • docs/package-lock.json
  • docs/package.json
  • docs/scripts/capture-screenshots.mjs
  • docs/src/components/Breadcrumbs.astro
  • docs/src/components/Footer.astro
  • docs/src/components/Header.astro
  • docs/src/components/Icon.astro
  • docs/src/components/Search.astro
  • docs/src/components/Sidebar.astro
  • docs/src/components/TableOfContents.astro
  • docs/src/components/ThemeToggle.astro
  • docs/src/content.config.ts
  • docs/src/layouts/BaseLayout.astro
  • docs/src/layouts/DocsLayout.astro
  • docs/src/lib/blog.ts
  • docs/src/lib/breadcrumbs.ts
  • docs/src/pages/404.astro
  • docs/src/pages/blog/[...slug].astro
  • docs/src/pages/blog/index.astro
  • docs/src/pages/index.astro
  • docs/src/plugins/rehype-a11y.mjs
  • docs/src/styles/blog.css
  • docs/src/styles/brand.css
  • docs/src/styles/global.css
  • docs/src/styles/site.css
  • docs/tests/a11y-sweep.spec.mjs
  • docs/tests/a11y.spec.mjs
  • docs/tests/blog.spec.mjs
  • docs/tests/search-keyboard.spec.mjs
  • docs/tests/search.spec.mjs
  • docs/tests/sidebar.spec.mjs
tests (1 file)
  • test/docs-build.test.ts

⚠️ Critical Files

  • docs/package.json

This report is generated automatically for every PR. See #733 for details.

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

🏗️ Architectural Review

Authoritative evidence: scanners from the PR base commit, posted by the default-branch workflow_run reporter.
Results for head commit d3cec7d800d75ca92befbf9b9236ef0cc460ccdd.

⚠️ Architectural review: 1 warning(s).

Severity Category Finding Files
🟡 warning sweeping-refactor This PR touches 37 files (36 modified/added, 1 deleted). Large PRs are harder to review — consider splitting if possible. —

Automated architectural review — informational only.

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

🔒 Security Review

Authoritative evidence: scanners from the PR base commit, posted by the default-branch workflow_run reporter.
Results for head commit d3cec7d800d75ca92befbf9b9236ef0cc460ccdd.

🔒 Security review: 1 info.

Severity Category Finding Location
ℹ️ info new-dependency 4 new/changed dependency version(s) in docs/package.json. Verify these packages are trusted and necessary. docs/package.json:20

Automated security review — informational only.

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

🛫 PR Readiness Check

ℹ️ This comment updates on each push. Last checked: commit d3cec7d

PR Scope: 🔧 Infrastructure

⚠️ 4 item(s) to address before review

Status Check Details
❌ Single commit 27 commits — consider squashing before review
✅ Not in draft Ready for review
❌ Branch up to date dev is 6 commit(s) ahead — rebase recommended
❌ Copilot review No Copilot review yet — it may still be processing
✅ Changeset present No source files changed — changeset not required
✅ Scope clean No .squad/ or docs/proposals/ files
✅ No merge conflicts No merge conflicts
✅ Copilot threads resolved 1 active Copilot thread(s) resolved (7 outdated skipped)
❌ CI passing 5 check(s) still running

Files Changed (37 files, +3370 −2068)

File +/−
docs/.astro/collections/blog.schema.json +9 −0
docs/.astro/content.d.ts +1 −1
docs/.gitignore +2 −0
docs/README.md +12 −2
docs/astro.config.mjs +4 −5
docs/package-lock.json +61 −777
docs/package.json +6 −3
docs/scripts/capture-screenshots.mjs +226 −0
docs/src/components/Breadcrumbs.astro +53 −0
docs/src/components/Footer.astro +66 −41
docs/src/components/Header.astro +52 −68
docs/src/components/Icon.astro +38 −0
docs/src/components/Search.astro +209 −112
docs/src/components/Sidebar.astro +43 −97
docs/src/components/TableOfContents.astro +63 −45
docs/src/components/ThemeToggle.astro +32 −14
docs/src/content.config.ts +2 −0
docs/src/layouts/BaseLayout.astro +38 −20
docs/src/layouts/DocsLayout.astro +27 −29
docs/src/lib/blog.ts +38 −0
docs/src/lib/breadcrumbs.ts +39 −0
docs/src/pages/404.astro +7 −7
docs/src/pages/blog/[...slug].astro +45 −19
docs/src/pages/blog/index.astro +373 −34
docs/src/pages/index.astro +185 −329
docs/src/plugins/rehype-a11y.mjs +59 −0
docs/src/styles/blog.css +237 −0
docs/src/styles/brand.css +597 −0
docs/src/styles/global.css +0 −389
docs/src/styles/site.css +316 −0
docs/tests/a11y-sweep.spec.mjs +87 −0
docs/tests/a11y.spec.mjs +227 −0
docs/tests/blog.spec.mjs +82 −0
docs/tests/search-keyboard.spec.mjs +79 −0
docs/tests/search.spec.mjs +15 −15
docs/tests/sidebar.spec.mjs +39 −60
test/docs-build.test.ts +1 −1

Total: +3370 −2068


This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.

This branch has not been deployed

No deployments
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.

3 participants