Skip to content

report: optional brand accent colour in ReportBranding (AA-contrast foreground) #2374

Description

@nc9

Goal

Reports can carry a brand accent colour. When a report's branding sets one, the HTML report uses it as its accent, with a foreground colour that keeps WCAG AA contrast. The text, markdown and XML outputs carry it as metadata.

Changes

  • packages/core-contracts/src/plans.ts: ReportBranding gains an optional brandColor (a hex colour, #RRGGBB, validated).
  • packages/report:
    • renderHtml applies brandColor as the accent CSS variable (output/page/styles.css plus html.tsx).
    • The foreground on accent surfaces is chosen for at least a 4.5:1 contrast ratio (black or white, whichever passes; fall back to the default accent if neither does).
    • Markdown, text and XML outputs include the colour in their branding metadata, unstyled.
  • No colour set: output is byte-identical to today, so golden snapshots are unchanged.

Acceptance Criteria

  • The brandColor type and validation are in place; invalid values are rejected by the contracts' validator.
  • The HTML report uses the brand accent, with an AA-passing foreground. Tests cover a light, a dark and a mid-tone brand colour.
  • With no brandColor, output is unchanged (existing goldens pass).
  • The docs page for report branding mentions the field.

nik

Activity

  1. added
    enhancement
    P2
    size: S
    on Nov 25, 2026
  2. added theissue type on Nov 25, 2026
  3. added
    in-progress
    on Nov 26, 2026
  4. self-assigned this
    on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2enhancementin-progresssize: S

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions