Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

GitHub Engineering 6 min read Case study mediumAdept

Unlocking inclusive design: how Primer’s color system is making GitHub.com more inclusive

GitHub's Primer design system fixed hundreds of color contrast violations across light and dark modes and all themes by changing its foundational color tokens (Primer Primitives) rather than individual components. The team audited 100+ text/background color pairs against WCAG ratios (4.5:1 and 3:1) and wrote a script that checks every pair across every theme. The script handles semi-transparent colors by first blending the background onto the page background, then blending the text onto that result. The check now runs as a GitHub Action on every Primer pull request, and the changes were rolled out to staff behind a feature flag before going live.

Assumes: WCAG contrast ratiosdesign tokens

Related posts

  • Continuous AI for accessibility: How GitHub transforms feedback into inclusion

    GitHub Engineering mediumAdept

    GitHub built an event-driven accessibility feedback pipeline on GitHub Actions, Copilot and the GitHub Models API that turns every user report into a tracked, prioritized issue. Issue creation triggers Copilot analysis that uses stored, PR-editable prompt files instead of fine-tuning. The analysis fills about 80% of 40+ metadata fields and suggests WCAG criteria, severity, affected user groups, team assignment and a reproduction checklist. A second Action parses Copilot's comment to apply labels and board status. Humans verify at each stage, and their corrections are logged to refine the prompts. About 75–80% of reports match existing audit findings and get reprioritized by real-world impact, and issues close only once the user confirms the fix works.

  • Design system annotations, part 2: Advanced methods of annotating components

    GitHub Engineering mediumAdept

    Design system teams can build their own "Preset annotations": Figma annotation components that carry accessibility details not conveyed visually, in component properties, or in code. GitHub picked ten Primer components using usage data from its Primer Query tool, audit frequency, React availability and org priorities. It then mapped the missing properties by cross-referencing Primer docs, Storybook demos, Figma asset properties, team experience and audit findings. Presets help newer teams most but need ongoing maintenance as components change, and the property mapping is groundwork for automated annotation. Figma Code Connect with hidden layers (e.g. an aria-label text property on IconButton) can bypass annotations entirely, with tips on consistency, branching and visual regression testing.

  • Illuminating dark mode

    Figma mediumAdept

    Figma built dark mode by replacing roughly 5,100 build-time PostCSS color variables with runtime CSS custom properties based on a semantic token schema (Type | UI Element | Color role | Prominence | Interaction), so new themes only require reassigning token values. Tokens are exported in the Design Tokens Format Module spec and compiled to CSS, Swift and XML. To spread the mostly manual refactor, forty engineers covered about 80% of in-scope surfaces in a single 'Dark Mode Week'. Supporting tooling included CSS fallbacks to the legacy variables to prevent regressions, a debug theme with random saturated colors to reveal unconverted surfaces, and a CIELAB-based search tool for finding the closest matching token.

  • How AI Assistants Can Decode GitHub Repos for UI Writers

    Docker mediumAdept

    An LLM agent can reliably flag user-facing copy changes in a branch when it is given narrow tools and expert hints about what "user-facing" means. GitHub Copilot's repo chat could not even count open PRs. A first prompt that gave the model bash and raw git diff also failed: diffs were huge, important files were buried and extra tools invited hallucination. The working two-step flow first lists only likely UI files (using --files-only and --no-pager with an alpine/git container) and saves the list. It then diffs just those files against main with --no-color --minimal, guided by frontend-engineer hints about JSX text nodes, notifications, toasts and Error constructors. This produced an accurate list of copy changes on a real Docker PR.

  • Building a more accessible GitHub CLI

    GitHub Engineering easyNovice

    GitHub CLI's Public Preview (v2.72.0, enabled via `gh a11y`) adapts accessibility practice to the terminal, where no WCAG-equivalent standard exists and screen readers must infer structure from a plain character grid. Interactive prompts were rebuilt on Charm's `huh` library so speech synthesis screen readers read them correctly. The redraw-based braille spinner was replaced with a static, context-specific text progress indicator. Markdown colors were realigned to the 16-color ANSI 4-bit palette, informed by Primer, so users can keep contrast against any terminal background and customize hues through their terminal settings. Planned work includes extending these features to CLI extensions and screen-reader-friendly table formatting.

The quest for software engineering knowledge.

Look:
Layout: