Github
Github
github
Design System
Github logo

Github

GitHub is the home of the world's software, and its interface reflects a deliberate engineering aesthetic: precise, legible, and quietly confident. The product surface is built on Primer, GitHub's open-source design system — a token-driven framework that has powered github.com for over a decade. The atmosphere is utilitarian without being cold; it is the

01

Color Palette

Brand

Accent

Neutrals

Semantic

02

Typography

Type Scale

Rendered in system-ui to clearly show scale & weight.

display48px · 600 · 1.25
Design at scale
32px32px · 600 · 1.25
Section heading
heading-lg24px · 600 · 1.4
Subheading
body16px · 400 · 1.5
Body text. The quick brown fox jumps over the lazy dog. Designed for readable line-height in long-form content.
small12px · 400 · 1.5
Supporting text
caption12px · 400 · 1.5
Caption · timestamp · 2026
label10px · 500 · 1.5
BADGE / LABEL

Fonts

Primary
Inter
Open · OFL
Designed by Rasmus Andersson. Variable font with full weight range.
Install via Google Fonts
Monospace
UI Monospace
Systemno install needed
CSS keyword — OS default mono (SF Mono / Consolas / etc.).
Not publicly distributed.
Monospace
SF Mono
Commercial
Apple's monospace. Free for Apple platforms.
Install via Apple Developer
Monospace
SF Mono
Commercial
Apple's monospace. Free for Apple platforms.
Install via Apple Developer
Monospace
Menlo
Systemno install needed
macOS pre-installed monospace.
Not publicly distributed.
Monospace
Consolas
Commercial
Microsoft system monospace (Windows).
Not publicly distributed.
Monospace
Liberation Mono
Open · OFL
Open-source metric-compatible alternative to Courier New.
Install via GitHub · liberationfonts
03

Spacing & Shape

Spacing

PurposeValuePreview
Densitycompact
Base unit8px
Section gap16px
Card padding16px
Element gap8px

Border Radius

ElementValuePreview
inlineSmall2px
tightSmall2px
buttonsDefault6px
inputsDefault6px
boxesDefault6px
theDefault6px
dialogsMedium12px
profileMedium12px
roundedMedium12px
labelsPill2px
countersPill2px
statePill2px

Elevation

Shadow 1
Shadow 2
Shadow 3
Shadow 4
The signature GitHub focus indicator
04

Guidelines

Do and Don't guidelines parsed from DESIGN.md.

Do

  • Use green (#1f883d) for the primary constructive action — this is GitHub's signature; commit/create/merge are green, never blue
  • Use blue (#0969da) for links and focus, not for primary buttons
  • Specify every component in both light and dark — dark mode is first-class, not optional
  • Use 1px borders (#d1d9e0) to structure content; reserve shadows for floating layers only
  • Use the monospace stack for all code, SHAs, file paths, and branch names
  • Keep 6px radius on buttons, inputs, and boxes; pills (2em) for labels and badges
  • Use 14px as the body baseline — GitHub UI is denser than consumer products
  • Apply the 3px blue focus ring (rgba(9,105,218,0.3)) on all keyboard-focusable elements
  • Use diff semantics: green for additions/success, red for deletions/danger, purple for merged/done

Don't

  • n't make the primary button blue — blue is for links; green is the primary action
  • n't use shadows on resting cards — a 1px border is the GitHub surface treatment
  • n't use Mona Sans / Hubot Sans in product UI — those are marketing display fonts only
  • n't style prose as monospace for "techy" flavor — mono is structural (alignment), not decorative
  • n't use pure white text on dark mode — use #e6edf3, the softened off-white
  • n't use pure black text on light mode — use #1f2328, the warm near-black
  • n't exceed 6px radius on buttons/inputs — GitHub is engineering-precise, not friendly-rounded
05

Components

Buttons

button-primary
Background#1f883d
Text#ffffff
Border1px solid rgba(31,35,40,0.15)
Radius6px
Padding0 16px
Font14px / 600
Hoverbg #1a7f37
Activebg #187733
Disabledbg #94d3a2 · text 0.8 opacity
Use: The one constructive primary action — Create/Commit/Merge. Never blue.
button-default
Background#f6f8fa
Text#1f2328
Border1px solid #d1d9e0
Radius6px
Padding0 16px
Font14px / 600
Hoverbg #eef1f4
Activebg #e6eaef
Use: The most common neutral button — Cancel/Edit, secondary actions
button-danger
Background#ffffff
Text#cf222e
Border1px solid #d1d9e0
Radius6px
Hoverbg #cf222e · text #ffffff · border #cf222e
Use: Destructive — Delete/Remove. Quiet until hovered, then commits to red.
button-invisible
Backgroundtransparent
Text#0969da
Bordernone
Radius6px
Hoverbg #f6f8fa
Use: Borderless tertiary — overflow triggers, icon buttons, in-row controls
icon-button
Backgroundtransparent
Text#59636e
Radius6px
Padding0
Hoverbg #f6f8fa
Use: Square icon-only control 28/32/40px, min 32x32 hit area — kebab menu, copy, bell
button-sizes
Radius6px
statessmall 28px / 12px / 0 12px · medium 32px / 14px / 0 16px · large 40px / 14px / 0 20px
Use: Button size scale (height · font · padding)

Inputs

text-input
Background#ffffff
Text#1f2328
Border1px solid #d1d9e0
Radius6px
Padding5px 12px
Font14px / 400
Focusborder #0969da + shadow 0 0 0 3px rgba(9,105,218,0.3)
stateserror border #cf222e + ring rgba(207,34,46,0.3) + #cf222e help text
Use: Standard form field; placeholder #818b98
select
Background#ffffff
Text#1f2328
Border1px solid #d1d9e0
Radius6px
Focusshadow 0 0 0 3px rgba(9,105,218,0.3)
Use: Native-backed dropdown styled as default input, trailing chevron #59636e

Toggles

checkbox
Border1px solid #d1d9e0
Radius3px
Focusshadow 0 0 0 3px rgba(9,105,218,0.3)
Activechecked #0969da fill + white check glyph
Use: 16px box; indeterminate shows a dash
radio
Border1px solid #d1d9e0
Radius9999px
Focusshadow 0 0 0 3px rgba(9,105,218,0.3)
Activechecked #0969da ring + filled #0969da dot
Use: 16px circle, mutually-exclusive option groups
toggle-switch
Background#818b98
Radius9999px
Activeon #1f883d
Use: Settings boolean, ~32px pill track, white thumb with subtle shadow

Cards

box
box
Background#ffffff
Text#1f2328
Border1px solid #d1d9e0
Radius6px
Padding16px
Shadownone
Use: Canonical container, border-first. Optional #f6f8fa header + 1px bottom border. Repo rows, settings panels.
tooltip
tooltip
Background#1f2328
Text#ffffff
Radius6px
Padding6px 12px
Font12px / 400
Use: Dark bubble with small directional arrow, on hover/focus, for icon-button labels and truncated text
banner
banner
Background#ddf4ff
Text#1f2328
Border1px solid rgba(9,105,218,0.4)
Radius6px
Padding16px
statesinfo #ddf4ff · success #dafbe1 · warning #fff8c5 · critical #ffebe9
Use: In-context message block, leading status icon + optional dismiss x; compact and flush layouts
flash
flash
Background#ddf4ff
Text#1f2328
Radius6px
Padding16px
statesinfo #ddf4ff · success #dafbe1 · warning #fff8c5 · critical #ffebe9
Use: Page-level banner spanning content width at page top; persists until navigation
image fills
inline-message
Text#1a7f37
statessuccess #1a7f37 · attention #9a6700 · danger #cf222e
Use: Compact single-line status beside a control, leading icon + tone-colored text — validation hints
image fills
spinner
Text#59636e
Use: Indeterminate circular loader, ~1.5px stroke, sizes 16/24/32/48px; replaces a button label during long ops
progress-bar
progress-bar
Background#d1d9e0
Text#1f883d
Radius9999px
Use: Rounded full track with green fill — language-breakdown bars, upload/operation progress
skeleton
skeleton
Background#f6f8fa
Radius6px
Use: Loading placeholders at final element geometry, subtle shimmer; SHAs/counts render as skeleton bars not values
image fills
blankslate
Text#1f2328
Use: Centered empty state — icon visual, #1f2328 heading, #59636e description, green primary action + optional secondary link; narrow/spacious/bordered variants

Badges

label
label
Background#ddf4ff
Text#0969da
Border1px solid #ddf4ff
Radius9999px
Padding0 7px
Font12px / 500
Use: Issue/PR tag tinted from its own hue at low alpha; ten color schemes
counter
counter-label
Backgroundrgba(175,184,193,0.2)
Text#1f2328
Radius9999px
Padding0 6px
Font12px / 400
Use: Numeric pill, tabular — tab/notification/star counts
state
state-label
Background#1f883d
Text#ffffff
Radius9999px
Padding4px 12px
Font12px / 500
statesopen #1f883d · merged #8250df · closed #cf222e · draft #59636e
Use: Large status pill atop an issue/PR, leading state icon
token
token
Background#f6f8fa
Text#1f2328
Border1px solid #d1d9e0
Radius9999px
Use: Removable chip with trailing x — assignees, topics, applied labels
branch
branch-name
Background#ddf4ff
Text#0969da
Radius6px
Padding0 6px
Fontmono
Use: Inline branch/ref reference in monospace

Avatars

A
avatar
Radius9999px
Use: Circular for people, 6px-radius square for orgs/teams/bots. Sizes 16-64px, default 20px.
A
avatar-stack
Borderwhite ring between
Radius9999px
Use: Overlapping circular avatars ~-8px overlap, collapsing a contributor list into a cluster

List items

action-list
action-list
Padding16px
Hoverbg #f6f8fa
Activeselected bg #ddf4ff + text #0969da
Use: Vertical list of actions in menus/panels; leading/trailing visuals, group headings, dividers, danger items
tree-view
tree-view
Hoverbg #f6f8fa
Activeselected bg #ddf4ff
Use: Indented file/symbol tree, 8px-step indentation, chevron disclosure on folders, keyboard-navigable
timeline
timeline
Border#d1d9e0 vertical rail
Use: Issue/PR activity thread; badge nodes (commit/comment/label/merge) and avatar-led rows. Merge event in #8250df done purple.

Dialogs

action-menu
Dialog content placeholder
action-menu
Background#ffffff
Border1px solid #d1d9e0
Radius6px
Shadow0 8px 24px rgba(31,35,40,0.2)
Use: An action-list rendered in an overlay popover — kebab overflow and dropdown menus
dialog
Dialog content placeholder
dialog
Background#ffffff
Border1px solid #d1d9e0
Radius12px
Padding16px
Shadow0 8px 24px rgba(31,35,40,0.2)
Use: Modal; rgba(31,35,40,0.5) scrim, 16px header + 1px bottom border, title 16px / 600. Confirmation/delete prompts.
overlay
Dialog content placeholder
overlay
Background#ffffff
Border1px solid #d1d9e0
Radius6px
Shadow0 3px 6px rgba(140,149,159,0.15)
Use: Floating-surface primitive (6-12px radius, medium/large shadow) — base for menus, popovers, dialogs

Tabs

TabTabTab
underline-nav
Text#1f2328
Border1px bottom border #d1d9e0
Font14px / 400
Hoverbg #f6f8fa
Activetext #1f2328 600 + 2px bottom border #fd8c73
Use: Primary tab pattern (Code/Issues/PR/Actions, profile tabs); neutral counter pills
TabTabTab
segmented-control
Background#f6f8fa
Border1px solid #d1d9e0
Activeselected white panel + 1px #d1d9e0 + small shadow
Use: Pick one of a small linear set; sizes 28/32px; collapses to dropdown/hideLabels in tight space
TabTabTab
breadcrumbs
Text#0969da
Activelast crumb #1f2328 no-link
Use: Inline path trail; #59636e slash separators. Repo file-path navigation.
TabTabTab
pagination
Text#0969da
Radius6px
Activecurrent page #0969da fill + #ffffff text
Use: Numbered links with prev/next chevrons under long issue/commit lists

Related design systems