Best For
GitHub style / GitHub design system / Primer design system
GitHub 风格
Rate this styleGitHub design language style with clean interface hierarchy, a refined grayscale system, blue interactive color, monospace code fonts, and developer-friendly information architecture.
Best For
GitHub style / GitHub design system / Primer design system
Primary Move
Use GitHub blue #0969da as the primary interaction color
Watch Out
Do not use gradient backgrounds or colorful decorations
design.md
One document describes the colour roles, type rules, spacing and component construction behind this style. Copy or download it into Claude Code or Codex.
Greyscale builds the structure, blue handles interaction, and color always carries meaning.
Theme: light
GitHub Style is the default language of developer tooling: most of the surface is greyscale (white, #f6f8fa, #d0d7de, #656d76, #1f2328 across five steps), blue #0969da appears only on things you can click, and green, yellow and red exist only as semantics — pass, warning, failure. Radius is uniformly 6px, borders are 1px #d0d7de, and shadow is nearly absent. Code blocks in monospace on a light grey ground are its most recognisable element. Gradients, heavy shadows, non-semantic decorative color, serif type and lively animation are all refused.
| Name | Value | Token | Role |
|---|---|---|---|
| Link Blue | #0969da | --color-link-blue | The only primary, used strictly on links, primary buttons and selection. |
| White | #ffffff | --color-white | Cards and content grounds — the only layering device against the light grey page. |
| Canvas Grey | #f6f8fa | --color-canvas-grey | The page canvas and code-block ground — the foundation of the whole interface. |
| Border Grey | #d0d7de | --color-border-grey | Every 1px border and divider — this one value and nothing else. |
| Muted Grey | #656d76 | --color-muted-grey | Metadata, timestamps and captions. |
| Ink | #1f2328 | --color-ink | Headings and body — a blue-cast dark grey, softer than pure black. |
| Success | #1f883d | --color-success | Passing, merged, success — semantic only. |
| Warning | #9a6700 | --color-warning | Pending and needs attention — semantic only. |
| Danger | #cf222e | --color-danger | Failure, deletion and conflict — semantic only. |
| Role | Family | Weight | Size | Line Height | Letter Spacing | Token |
|---|---|---|---|---|---|---|
| heading-lg | — | 600 | 24px | 1.25 | — | --text-heading-lg |
| heading | — | 600 | 20px | 1.3 | — | --text-heading |
| subheading | — | 600 | 16px | 1.4 | — | --text-subheading |
| body | — | 400 | 14px | 1.5 | — | --text-body |
| body-sm | — | 400 | 13px | 1.5 | — | --text-body-sm |
| label | — | 500 | 12px | 1.4 | 0.02em | --text-label |
Base unit: 4px Density: compact
| Name | Value | Token |
|---|---|---|
| 4 | 4px | --spacing-4 |
| 8 | 8px | --spacing-8 |
| 12 | 12px | --spacing-12 |
| 16 | 16px | --spacing-16 |
| 24 | 24px | --spacing-24 |
| 32 | 32px | --spacing-32 |
| 48 | 48px | --spacing-48 |
| Element | Value |
|---|---|
| cards | 6px |
| buttons | 6px |
| inputs | 6px |
| pills | 999px |
Role: Primary action
Success green #1f883d fill, white text, 6px radius, a 1px rgba(31,35,40,0.15) border, no shadow, 14px/500, 5px 16px padding. Hover deepens the fill to #1a7f37; press adds an inset 0 1px 0 shadow at 10%. 80ms. The primary button is green while links are blue, and the two never swap roles.
Role: Repository and content cards
White fill, 6px radius, a 1px #d0d7de border, 16px padding, no shadow. The title runs 16px/600 in link blue as the clickable element, description at 14px ink, and a 12px muted line below with a language dot, star count and update time. Hover leaves the border alone and simply underlines the title.
Role: The code block, the identifying element
A #f6f8fa ground, 6px radius, a 1px #d0d7de border, 16px padding, JetBrains Mono at 13px on 1.5 leading, horizontally scrollable. Syntax highlighting uses five or six colors and never changes weight. A 12px muted copy button may sit top-right.
Role: State labels and badges
Fully rounded on a 10% semantic ground with semantic text and a 1px border at 25%, 12px/500, 2px 10px padding. Green for passing, yellow for pending, red for failure, blue for info. Every label carries text; color only assists.
Role: Side navigation and filters
White or transparent at 240px wide with no right border. Items are 32px tall on a 6px radius at 14px, with selection using a #f6f8fa ground plus a 2px link-blue left bar. Group headings sit 16px above at 12px/600 in muted grey.
| Level | Name | Value | Purpose |
|---|---|---|---|
| 0 | Canvas Grey | #f6f8fa | 页面底 |
| 1 | White | #ffffff | 卡片与列表容器 |
none — 1px #d0d7de borders only0 8px 24px rgba(31,35,40,0.12)Almost no imagery: avatars at 20 to 40px, 16px icons, 8px language dots. No illustration, photography or backgrounds — the interface is the content.
Capped at 1280px with 16px padding, 24px between sections and 16px between cards. The structure is a 240px rail beside a content area whose list rows run 56px. Density approaches a desktop application, with whitespace only between sections.
QUICK COLOR REFERENCE:
#1f2328#f6f8fa#ffffff#0969da#d0d7de#656d76EXAMPLE COMPONENT PROMPTS:
:root {
/* Colors */
--color-link-blue: #0969da;
--color-white: #ffffff;
--color-canvas-grey: #f6f8fa;
--color-border-grey: #d0d7de;
--color-muted-grey: #656d76;
--color-ink: #1f2328;
--color-success: #1f883d;
--color-warning: #9a6700;
--color-danger: #cf222e;
/* Typography — Font Families */
--font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
--font-mono: 'JetBrains Mono', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
/* Typography — Scale */
--text-heading-lg: 24px;
--leading-heading-lg: 1.25;
--text-heading: 20px;
--leading-heading: 1.3;
--text-subheading: 16px;
--leading-subheading: 1.4;
--text-body: 14px;
--leading-body: 1.5;
--text-body-sm: 13px;
--leading-body-sm: 1.5;
--text-label: 12px;
--leading-label: 1.4;
--tracking-label: 0.02em;
/* Typography — Weights */
--font-weight-regular: 400;
--font-weight-medium: 500;
--font-weight-semibold: 600;
/* Spacing */
--spacing-unit: 4px;
--spacing-4: 4px;
--spacing-8: 8px;
--spacing-12: 12px;
--spacing-16: 16px;
--spacing-24: 24px;
--spacing-32: 32px;
--spacing-48: 48px;
/* Layout */
--page-max-width: 1280px;
--section-gap: 24px;
--card-padding: 16px;
--element-gap: 8px;
--density: compact;
/* Border Radius */
--radius-cards: 6px;
--radius-buttons: 6px;
--radius-inputs: 6px;
--radius-pills: 999px;
/* Surfaces */
--surface-canvas-grey: #f6f8fa;
--surface-white: #ffffff;
}
Component Templates
FAQ
/* GitHub Style 全局样式 */
:root {
--gh-blue: #0969da;
--gh-green: #1f883d;
--gh-yellow: #9a6700;
--gh-red: #cf222e;
--gh-fg: #1f2328;
--gh-fg-muted: #656d76;
--gh-bg: #ffffff;
--gh-bg-subtle: #f6f8fa;
--gh-border: #d0d7de;
--gh-nav-bg: #24292f;
}
/* 基础文字样式 */
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
color: var(--gh-fg);
line-height: 1.5;
font-size: 14px;
}
/* 代码块 */
.gh-code {
font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
font-size: 85%;
background: var(--gh-bg-subtle);
border-radius: 6px;
padding: 0.2em 0.4em;
}
/* 仓库名称链接 */
.gh-repo-link {
color: var(--gh-blue);
font-weight: 600;
text-decoration: none;
}
.gh-repo-link:hover {
text-decoration: underline;
}
/* 标签/徽章 */
.gh-label {
display: inline-block;
padding: 0 7px;
font-size: 12px;
font-weight: 500;
line-height: 18px;
border: 1px solid transparent;
border-radius: 2em;
}
/* 分隔线 */
.gh-divider {
border: none;
border-top: 1px solid var(--gh-border);
margin: 1rem 0;
}
@keyframes github-style-fade-in {
from { opacity: 0; transform: translateY(8px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes github-style-pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.7; }
}
.github-style-card {
position: relative;
overflow: hidden;
}
.github-style-card::before {
content: "";
position: absolute;
inset: 0;
opacity: 0;
transition: opacity 0.3s ease;
background: linear-gradient(135deg, rgba(9, 105, 218, 0.05), transparent);
pointer-events: none;
}
.github-style-card:hover::before {
opacity: 1;
}
.github-style-gradient {
background: linear-gradient(135deg, #0969da, #1f883d);
}
.github-style-gradient-text {
background: linear-gradient(135deg, #0969da, #1f883d);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.github-style-frosted {
backdrop-filter: blur(12px) saturate(180%);
-webkit-backdrop-filter: blur(12px) saturate(180%);
background: rgba(9, 105, 218, 0.08);
}
.github-style-accent-corner {
clip-path: polygon(0 0, 100% 0, 100% calc(100% - 2rem), calc(100% - 2rem) 100%, 0 100%);
}
.github-style-animate-in {
animation: github-style-fade-in 0.5s ease-out both;
}Related Styles
Explore these styles for ready-made tokens and components.
GitHub Style and Fluent Design sit closest to each other. The table below gives the real differences in color, use case, and tags, so the choice between them is made on facts.
| Attribute | GitHub Style | Fluent Design |
|---|---|---|
| Primary color | #0969da | #0078d4 |
| Secondary color | #ffffff | #106ebe |
| Best for | GitHub style / GitHub design system / Primer design system | Fluent Design / Microsoft Fluent / acrylic material |
| Unique tags | — | — |
GitHub Style is a design language originating from the GitHub platform, providing clear, efficient, and distraction-free working interfaces for tens of millions of developers worldwide. Its design philosophy is "let the content speak."
Design Recipes
These curated recipes combine this style with layouts and animations, optimized for specific use cases.