Skip to content

Align docs site custom CSS with GitHub Docs color system while preserving landing page purples#39997

Closed
Copilot wants to merge 3 commits into
mainfrom
copilot/update-custom-css-starlight
Closed

Align docs site custom CSS with GitHub Docs color system while preserving landing page purples#39997
Copilot wants to merge 3 commits into
mainfrom
copilot/update-custom-css-starlight

Conversation

Copilot AI commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

This updates the Starlight docs theme so the documentation pages read closer to GitHub Docs instead of the previous purple-heavy palette, while preserving the purple treatment on the landing page. The change is focused on shared color tokens and the major UI surfaces that define the docs experience.

  • Theme tokens

    • Replaced the primary accent scale in both light and dark themes with GitHub Docs-style blues for the docs experience.
    • Updated focus, link, and selection-adjacent accent usage to flow from the new token set on non-landing pages.
  • Core surfaces

    • Reworked page and header gradients to use GitHub Docs-like neutral canvases with blue-tinted highlights across the docs site.
    • Tightened border and overlay colors so headers, sidebars, and panels feel closer to GitHub’s docs chrome.
  • Interactive states

    • Updated link hovers, current-nav states, focus rings, badges, and pagination cards to use blue emphasis instead of violet on documentation pages.
    • Kept the landing page hero CTA buttons, badges, glow, and accent treatments on the previous purple palette.
  • Content affordances

    • Adjusted markdown accents used in diagrams, cards, and supporting UI elements to keep code/content pages visually consistent with the new theme without changing the landing page brand treatment.
:root[data-theme='light'] {
  --sl-color-accent-low: #ddf4ff;
  --sl-color-accent: #0969da;
  --sl-color-accent-high: #0550ae;
  --sl-color-text-accent: #0969da;
}

body.landing-page .sl-link-button.primary {
  background: rgba(139, 92, 246, 0.35) !important;
  border: 1px solid rgba(139, 92, 246, 0.6) !important;
}

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title Update docs site colors to better match GitHub Docs Align docs site custom CSS with GitHub Docs color system Jun 18, 2026
Copilot AI requested a review from pelikhan June 18, 2026 06:09
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot show screenshots

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

@copilot show screenshots

Added in 04e5b3a:

Homepage (light)
Homepage light

Homepage (dark)
Homepage dark

Quick Start (light)
Quick Start light

Quick Start (dark)
Quick Start dark

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot keep purples for the landing page

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

@copilot keep purples for the landing page

Addressed in 065627b.

Copilot AI changed the title Align docs site custom CSS with GitHub Docs color system Align docs site custom CSS with GitHub Docs color system while preserving landing page purples Jun 18, 2026
@pelikhan pelikhan marked this pull request as ready for review June 18, 2026 11:31
Copilot AI review requested due to automatic review settings June 18, 2026 11:31

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.

Pull request overview

This PR updates the Starlight docs site styling to align the docs pages with GitHub Docs’ blue-based color system, while introducing landing-page-specific overrides intended to preserve the previous purple branding treatment on the home/hero page.

Changes:

  • Replaced global accent tokens (light + dark) from purple to GitHub Docs-style blues and propagated those updates across key UI surfaces (backgrounds, header chrome, links, badges, pagination, focus rings).
  • Updated Mermaid diagram styling and other content affordances to match the new blue accent palette.
  • Added body.landing-page CSS overrides to restore the prior purple palette and background treatments on the landing page.
Show a summary per file
File Description
docs/src/styles/custom.css Replaces site-wide accent palette with GitHub Docs blues and adds landing-page-specific purple overrides.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/5 changed files
  • Comments generated: 2

Comment on lines +1604 to +1608
body.landing-page .sl-markdown-content a:hover,
body.landing-page nav a:hover {
color: #d896ff;
border-bottom-color: rgba(216, 150, 255, 0.3);
}
Comment on lines +1610 to +1615
:root[data-theme='light'] body.landing-page a,
:root[data-theme='light'] body.landing-page nav a:hover,
:root[data-theme='light'] body.landing-page nav a[aria-current="page"],
:root[data-theme='light'] body.landing-page .sl-markdown-content a:hover {
color: #5b3da3;
}
@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

No test files were added or modified in this PR. The PR only changes docs/src/styles/custom.css and adds image files under docs/public/images/pr-review/. Test Quality Sentinel skipped.

@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Design Decision Gate 🏗️ completed the design decision gate check.

No ADR enforcement needed: PR #39997 does not have the 'implementation' label (has_implementation_label=false) and has 0 new lines of code in business logic directories (well below the 100-line threshold). The changes are docs/CSS theme updates, not core business logic.

@github-actions github-actions Bot mentioned this pull request Jun 18, 2026

@github-actions github-actions Bot 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.

Skills-Based Review 🧠

Applied /zoom-out and /improve-codebase-architecture — commenting on maintainability issues and one subtle correctness regression.

📋 Key Themes & Highlights

Key Themes

  • Specificity regression: Light landing page a:hover no longer changes color (the broad :root[data-theme='light'] body.landing-page a rule outranks the base a:hover rule due to higher specificity)
  • DRY concern: Purple RGB value 139, 92, 246 is hardcoded in 6+ rgba() calls; an --landing-accent-rgb custom property would centralise this
  • Cross-file coupling: The body.landing-page CSS block depends on a JS pathname-detection script in CustomHead.astro with no in-CSS pointer to that dependency
  • Binary assets: Four JPEG screenshots appear to be PR-review evidence only and should not be committed to the repository

Positive Highlights

  • var(--sl-color-purple)var(--sl-color-accent) is a clean semantic improvement that makes the video caption border respond correctly to both themes automatically
  • ✅ The body.landing-page CSS scoping pattern is a sound approach to split-section theming without Starlight plugins
  • ✅ CSS custom property overrides on body.landing-page correctly cascade above :root values because body is a descendant of html, so the purple accent tokens flow through cleanly
  • ✅ Light/dark theme switching handled correctly via :root[data-theme='light'] body.landing-page selectors

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

Comments that could not be inline-anchored

docs/src/styles/custom.css:1619

[/improve-codebase-architecture] Light landing page a:hover has no color change — link color stays #5b3da3 on hover, silently dropping the #6b46c1 hover contrast from the original palette.

Because :root[data-theme=&#39;light&#39;] body.landing-page a { color: #5b3da3 } (specificity 0,2,3) outranks the base :root[data-theme=&#39;light&#39;] a:hover { color: #0550ae } (0,2,2), hover never fires a color shift on the light landing page.

<details>
<summary>💡 Suggested fix</summary>

Add an explicit…

docs/src/styles/custom.css:1625

[/improve-codebase-architecture] The purple RGB channel 139, 92, 246 is hardcoded in 6+ rgba() calls across this block, creating a single-point-of-failure for any future purple brand tweak.

<details>
<summary>💡 Suggested refactor</summary>

Define a CSS custom property on body.landing-page and reference it via color-mix or an --*-rgb pattern:

body.landing-page {
  /* existing token overrides */
  --landing-accent-rgb: 139, 92, 246;
}

/* then in button overrides */
body.…

</details>

<details><summary>docs/src/styles/custom.css:1564</summary>

**[/zoom-out]** The `body.landing-page` class is assigned by pathname-detection JS in `docs/src/components/CustomHead.astro` (checking for `/gh-aw/`). If the docs base URL ever changes, all these overrides silently become dead code with no CSS-level indication of the dependency.

Consider adding a brief comment here pointing to that coupling:

```css
/*
 * Landing-page class is applied by the inline script in CustomHead.astro.
 * Search for `classList.add(landing-page)` if the base path changes…

</details>

<details><summary>docs/src/styles/custom.css:1600</summary>

**[/improve-codebase-architecture]** `a:hover` and `nav a[aria-current=&quot;page&quot;]` share a color today, but they are semantically unrelated states. Grouping them makes future independent color changes error-prone.

&lt;details&gt;
&lt;summary&gt;💡 Suggested split&lt;/summary&gt;

```css
/* hover: slightly lighter than rest state */
body.landing-page a:hover {
  color: #e5c7ff;
}

/* active nav item */
body.landing-page nav a[aria-current=&quot;page&quot;] {
  color: #e5c7ff;
}

Verbose but safe — changing one no longer …

docs/public/images/pr-review/docs-home-dark.jpg:1

[/zoom-out] These four JPEG screenshots appear to be visual evidence for PR review, not referenced in any docs page content. Committing them permanently adds binary blob weight to git history and ships them as site assets to every visitor.

Consider uploading them directly as images in the PR description (drag-and-drop into the text box) and removing this commit of binary files. If they are intended as part of the docs site, the path should reflect that intent (e.g. `docs/public/images/scre…

docs/src/styles/custom.css:1580

[/improve-codebase-architecture] display: block here is already guaranteed by body:has(.hero)::before { display: block } on line 416 (the landing page always has a .hero element). The redundant declaration is harmless, but it slightly obscures the real control flow.

<details>
<summary>💡 Options</summary>

  • Remove display: block from this rule; it only sets background, which is its real purpose.
  • Or keep it and add a comment: `/* also covered by body:has(.hero)::before,…

@github-actions github-actions Bot 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.

The blue-to-purple split is sensible and the specificity math for the landing page overrides is correct. Two issues block merge.

### Blocking issues (2)

1. Missing focus-ring override (high):focus-visible was hard-coded to blue (#58a6ff / #0969da) but the new body.landing-page block has no :focus-visible override. Keyboard users on the landing page will see blue focus rings on purple buttons and links. See inline comment at line 1345.

2. Flash of incorrect styles from JS-dependent class (medium)body.landing-page is applied after first paint via DOMContentLoaded, so the landing page briefly renders in blue. The CSS already uses body:has(.hero) for the glow effect — the same zero-JS pattern should be used for all the landing-page overrides. See inline comment at line 1564.

### Already-flagged in existing review
  • Line 1608: body.landing-page .sl-markdown-content a:hover wins over body.landing-page a:hover due to specificity, making the lighter #e5c7ff hover color unreachable for markdown links.
  • Line 1615: Light-theme landing page hover color equals the base link color — no visible hover feedback.

🔎 Code quality review by PR Code Quality Reviewer

/* Focus Visible State */
:focus-visible {
outline: 2px solid #d896ff;
outline: 2px solid #58a6ff;

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.

Missing body.landing-page :focus-visible override: keyboard focus rings on the landing page will render blue despite the purple theme intent.

💡 Suggested fix

The :focus-visible outline was changed from purple to blue here, but the body.landing-page block (added further below) doesn't include a corresponding override. Any keyboard-navigable element on the landing page — the CTA button, nav links — will show a #58a6ff blue focus ring against a purple-themed page. This is especially jarring on the primary CTA whose background is the restored purple.

Both rules use hardcoded hex values (not var(--sl-color-accent)), so the CSS custom property overrides on body.landing-page do not automatically fix this — an explicit selector is required:

body.landing-page :focus-visible {
  outline-color: #d896ff;
}

:root[data-theme='light'] body.landing-page :focus-visible {
  outline-color: #6b46c1;
}

}

/* Keep the landing page on the previous purple palette while docs pages use the GitHub Docs blues. */
body.landing-page {

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.

JS-dependent class risks a flash of incorrect styles (FOCS): body.landing-page is added by an inline script that runs after first paint, so the landing page renders in blue before switching to purple.

💡 Why this matters and how to fix it

The CustomHead.astro inline script checks window.location.pathname and calls document.body.classList.add('landing-page'). Because document.body is null when <head> scripts execute, the code falls back to DOMContentLoaded — meaning the class is applied after the browser has already painted the first frame. Users will see the blue docs theme flash briefly before the purple overrides land.

The file already solves this problem at line 416:

body:has(.hero)::before {
  display: block;
}

That selector is CSS-native and zero-JS — the <body> carries .hero in the server-rendered HTML. Replacing body.landing-page with body:has(.hero) throughout this block eliminates the FOCS entirely:

body:has(.hero) {
  --sl-color-accent-low: #6639ba;
  --sl-color-accent: #d896ff;
  /* ... */
  background: linear-gradient(...) !important;
}
:root[data-theme='light'] body:has(.hero) { ... }
body:has(.hero)::before { background: ... }
/* etc. */

If body.landing-page must stay for other reasons, inject the class synchronously via a <script> placed immediately before </body>, or add landing-page server-side in the Astro component when the route is the index page.

@pelikhan pelikhan closed this Jun 18, 2026
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