Style Catalog/GitHub Style

GitHub Style

GitHub 风格

D
47/100Poor
Rate this style

GitHub design language style with clean interface hierarchy, a refined grayscale system, blue interactive color, monospace code fonts, and developer-friendly information architecture.

GitHub styleGitHub design systemPrimer design systemdeveloper tool uimonospace fontgrayscale palettecode syntax highlightingdocumentation sitedeveloper portfolioclean minimal interface
View Full Showcase →
Templates

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

AI Implementation

Copy the Hard Prompt first, then use the spec when needed

Use the Hard Prompt by default to generate UI. Use the Design Spec to understand, modify, and review the style. Use the Creative Brief for early exploration.

Hard Prompt

Use this by default: copy it, append the concrete requirement, and let AI generate consistent production UI.

When to use

  • When AI should generate UI directly
  • When repeated outputs must stay consistent
  • When style drift is the main risk

How to use

  • Copy the full prompt
  • Append the concrete requirement
  • Review against forbidden rules and UI states
STYLEKIT_STYLE_REFERENCE
style_name: GitHub Style
style_slug: github-style
style_source: /styles/github-style

# Hard Prompt

## When To Use
Use this when you want AI to generate code with strict style consistency. It is the safest default for production UI.

## How To Use
- Copy the full prompt into ChatGPT, Claude, Cursor, or another coding assistant.
- Append the concrete product/page requirement after the prompt.
- After generation, check the forbidden rules and interaction states before accepting the output.

Strictly follow the style rules below and maintain consistency. No style drift allowed.

## Requirements

- Prioritize style consistency first, then creative extension.
- When conflicts arise, treat prohibitions as the highest priority.
- Self-check before output: verify colors, typography, spacing, and interactions still match this style.

## Style Rules

You are a GitHub Style design frontend development expert. All generated code must strictly follow these constraints:

## Absolutely Forbidden

- Gradient backgrounds bg-gradient-*
- Large rounded corners rounded-2xl, rounded-3xl (except avatars)
- Heavy shadows shadow-lg, shadow-xl
- Non-semantic decorative colors
- Serif fonts
- Oversized fonts or overly wide spacing
- Dynamic flashy animations

## Must Follow

- Blue #0969da as the primary interaction color
- Backgrounds: #ffffff, #f6f8fa
- Text: #1f2328 (primary), #656d76 (secondary)
- Borders: border-[#d0d7de]
- Rounded corners: rounded-md (6px)
- Code: font-mono bg-[#f6f8fa]

## Semantic Functional Colors

- Success/merge: #1f883d (green)
- Warning/pending: #9a6700 (yellow)
- Danger/delete: #cf222e (red)
- Interaction/link: #0969da (blue)

## Color Palette

Grayscale system:
- Text: #1f2328
- Secondary text: #656d76
- Light text: #8b949e
- Border: #d0d7de
- Light background: #f6f8fa
- Background: #ffffff
- Dark navigation: #24292f

## Animation & Interaction Rules

- Extreme Utility: Interactions prioritize state expression, avoiding eye-catching displacement/scaling effects. Duration kept at 75 to 150.
- Micro-Tactility: Button press provides only slight confirmation (e.g., active:scale-[0.98] + background darkening), not overly skeuomorphic.
- A11y Focus Rings: Focus state must provide clear ring (focus:ring-4 + brand blue/green transparency), not just border color change.
- Subtle Borders: Card hover primarily adjusts background and border shade, not using obvious shadows.

## Self-Check

After each code generation, verify:
1. No gradients used
2. Rounded corners consistently rounded-md
3. Shadows extremely light or none
4. Colors used with correct semantics
5. Overall feel is clean and professional

---

# GitHub Style Design System

> GitHub design language style with clean interface hierarchy, a refined grayscale system, blue interactive color, monospace code fonts, and developer-friendly information architecture.

## Design Philosophy

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."

Core concepts:
- Content first: Code and documentation are the protagonists; UI is the supporting cast. All design decisions serve content readability and actionability
- Grayscale system: A refined grayscale hierarchy builds visual layers -- from #1f2328 (text) to #f6f8fa (background), each shade of gray has a clear semantic role
- Blue interaction: #0969da as the sole primary interaction color, precisely guiding user attention in a gray world
- Semantic functional colors: Green for success/merge, yellow for warning/pending, red for danger/delete -- each color has a clear meaning

This style is suitable for developer tools, code platforms, technical documentation, project management, and any product targeting a technical audience.

GitHub's design proves a truth: in information-dense scenarios, restrained visual design actually creates the best user experience. Every pixel of decoration must have a clear functional reason, or it should not exist.

---

## Token Dictionary (exact class mapping)

### Border
```
Width: border
Color: border-[#d0d7de]
Radius: rounded-md
```

### Shadow
```
sm: shadow-[0_1px_0_rgba(27,31,36,0.04)]
md: shadow-[0_1px_3px_rgba(27,31,36,0.12)]
lg: shadow-[0_3px_6px_rgba(140,149,159,0.15)]
hover: hover:shadow-[0_1px_3px_rgba(27,31,36,0.12)]
focus: focus:shadow-[0_0_0_3px_rgba(9,105,218,0.3)]
```

### Interaction
```
Hover translate: (none)
Hover scale: (none)
Hover opacity: hover:bg-[#f6f8fa]
Transition: transition-colors duration-150
Active: active:bg-[#e8e8e8]
```

### Typefaces
```
Heading: font-semibold text-[#1f2328]
Body: text-sm text-[#1f2328]
Mono: font-mono text-sm text-[#1f2328]
```

### Type scale
```
Hero: text-3xl md:text-4xl
H1: text-2xl md:text-3xl
H2: text-xl md:text-2xl
H3: text-lg md:text-xl
Body: text-sm
Small: text-xs
```

### Spacing
```
Section: py-6 md:py-8
Container: px-4 md:px-6
Card: p-3 md:p-4
Gap sm: gap-2
Gap md: gap-3
Gap lg: gap-4
```

### Color roles
```
Background primary: bg-white
Background secondary: bg-[#f6f8fa]
Background accent: bg-[#0969da], bg-[#1f883d], bg-[#cf222e]
Text primary: text-[#1f2328]
Text secondary: text-[#656d76]
Text muted: text-[#8b949e]
Button primary: bg-[#1f883d] text-white border border-[#1b7f37]
Button secondary: bg-[#f6f8fa] text-[#1f2328] border border-[#d0d7de]
```

---

## [FORBIDDEN]

These classes are banned in this style. Check for them before returning code:

### Banned classes
- `rounded-2xl`
- `rounded-3xl`
- `rounded-full`
- `bg-gradient-to-r`
- `bg-gradient-to-br`
- `bg-gradient-to-b`
- `shadow-lg`
- `shadow-xl`
- `shadow-2xl`
- `font-serif`
- `text-4xl`
- `text-5xl`
- `text-6xl`
- `text-7xl`
- `blur-sm`
- `blur-md`
- `blur-lg`

### Banned patterns
- matches `^rounded-(?:2xl|3xl|full)`
- matches `^bg-gradient`
- matches `^shadow-(?:lg|xl|2xl)`
- matches `^text-(?:[4-9]xl)`
- matches `^blur-`

### Why they are banned
- `rounded-2xl`: GitHub uses consistent rounded-md (6px) corners
- `rounded-full`: GitHub reserves rounded-full for avatars and labels only
- `bg-gradient-to-r`: GitHub uses flat, solid colors without gradients
- `shadow-lg`: GitHub uses minimal shadows; heavy shadows break the clean aesthetic
- `font-serif`: GitHub uses system sans-serif and monospace fonts only
- `blur-sm`: GitHub does not use blur effects; keep everything crisp

> WARNING: if your code contains any of the above, replace it before shipping.

---

## [REQUIRED]

### Every button must include
```
rounded-md
text-sm font-semibold
border
shadow-[0_1px_0_rgba(27,31,36,0.04)]
transition-colors duration-150
```

### Every card must include
```
bg-white
border border-[#d0d7de]
rounded-md
```

### Every input must include
```
bg-[#f6f8fa]
border border-[#d0d7de]
rounded-md
text-sm text-[#1f2328]
focus:bg-white
focus:border-[#0969da]
focus:shadow-[0_0_0_3px_rgba(9,105,218,0.3)]
focus:outline-none
```

---

## [COMPARE] GitHub Style wrong vs right

The wrong examples below stand for generic library defaults that were never adapted to this style. Do not read them as visual suggestions.

### Button

[WRONG] **Wrong** (generic component library default, do not copy):
```html
<button class="{GENERIC_LIBRARY_BUTTON_DEFAULT}">
  Click me
</button>
```

[CORRECT] **Right** (uses this style's tokens):
```html
<button class="rounded-md text-sm font-semibold border shadow-[0_1px_0_rgba(27,31,36,0.04)] transition-colors duration-150 bg-[#1f883d] text-white border border-[#1b7f37]">
  Click me
</button>
```

### Card

[WRONG] **Wrong** (generic card, not adapted to this style):
```html
<div class="{GENERIC_LIBRARY_CARD_DEFAULT}">
  <h3>{TITLE}</h3>
</div>
```

[CORRECT] **Right** (uses this style's card tokens):
```html
<div class="bg-white border border-[#d0d7de] rounded-md p-3 md:p-4">
  <h3 class="font-semibold text-[#1f2328] text-lg md:text-xl">{TITLE}</h3>
</div>
```

### Input

[WRONG] **Wrong** (generic input, not adapted to this style):
```html
<input class="{GENERIC_LIBRARY_INPUT_DEFAULT}" />
```

[CORRECT] **Right** (uses this style's input tokens):
```html
<input class="bg-[#f6f8fa] border border-[#d0d7de] rounded-md text-sm text-[#1f2328] focus:bg-white focus:border-[#0969da] focus:shadow-[0_0_0_3px_rgba(9,105,218,0.3)] focus:outline-none" placeholder="{PLACEHOLDER}" />
```

---

## [TEMPLATES] GitHub Style page skeletons

These skeletons use this style's tokens only. Replace `{PLACEHOLDER}` values, but keep every token in place:

### Navigation
```html
<nav class="bg-white text-[#1f2328] border border-[#d0d7de] px-4 md:px-6">
  <div class="flex items-center justify-between max-w-6xl mx-auto gap-3">
    <a href="/" class="font-semibold text-[#1f2328] text-lg md:text-xl">
      {LOGO_TEXT}
    </a>
    <div class="flex gap-3 text-sm text-[#1f2328] text-xs">
      {NAV_LINKS}
    </div>
  </div>
</nav>
```

### Hero section
```html
<section class="bg-[#0969da] text-[#1f2328] py-6 md:py-8 px-4 md:px-6">
  <div class="max-w-4xl mx-auto">
    <h1 class="font-semibold text-[#1f2328] text-3xl md:text-4xl">
      {HEADLINE}
    </h1>
    <p class="text-sm text-[#1f2328] text-sm max-w-xl">
      {SUBHEADLINE}
    </p>
    <button class="rounded-md text-sm font-semibold border shadow-[0_1px_0_rgba(27,31,36,0.04)] transition-colors duration-150 bg-[#1f883d] text-white border border-[#1b7f37]">
      {CTA_TEXT}
    </button>
  </div>
</section>
```

### Card grid
```html
<section class="bg-white text-[#1f2328] py-6 md:py-8 px-4 md:px-6">
  <div class="max-w-6xl mx-auto">
    <h2 class="font-semibold text-[#1f2328] text-xl md:text-2xl">{SECTION_TITLE}</h2>
    <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3">
      <!-- Card template - repeat for each card -->
      <div class="bg-white border border-[#d0d7de] rounded-md p-3 md:p-4">
        <h3 class="font-semibold text-[#1f2328] text-lg md:text-xl">{CARD_TITLE}</h3>
        <p class="text-sm text-[#1f2328] text-sm text-[#8b949e]">{CARD_DESCRIPTION}</p>
      </div>
    </div>
  </div>
</section>
```

### Form input
```html
<input class="bg-[#f6f8fa] border border-[#d0d7de] rounded-md text-sm text-[#1f2328] focus:bg-white focus:border-[#0969da] focus:shadow-[0_0_0_3px_rgba(9,105,218,0.3)] focus:outline-none" placeholder="{PLACEHOLDER}" />
```

### Footer
```html
<footer class="bg-[#f6f8fa] text-[#656d76] py-6 md:py-8 px-4 md:px-6">
  <div class="max-w-6xl mx-auto">
    <div class="grid grid-cols-1 md:grid-cols-3 gap-4">
      <div>
        <span class="font-semibold text-[#1f2328] text-lg md:text-xl">{LOGO_TEXT}</span>
        <p class="text-sm text-[#1f2328] text-xs">{TAGLINE}</p>
      </div>
      <div>
        <h4 class="font-semibold text-[#1f2328] text-lg md:text-xl">{COLUMN_TITLE}</h4>
        <ul class="text-sm text-[#1f2328] text-xs">
          {FOOTER_LINKS}
        </ul>
      </div>
    </div>
  </div>
</footer>
```

---

## [CHECKLIST] GitHub Style post-generation self check

**Before returning code, verify every token and rule below. Fix any violation before delivering:**

### Token check
- [ ] Button includes: `rounded-md text-sm font-semibold border shadow-[0_1px_0_rgba(27,31,36,0.04)] transition-colors duration-150`
- [ ] Card includes: `bg-white border border-[#d0d7de] rounded-md`
- [ ] Input includes: `bg-[#f6f8fa] border border-[#d0d7de] rounded-md text-sm text-[#1f2328] focus:bg-white focus:border-[#0969da] focus:shadow-[0_0_0_3px_rgba(9,105,218,0.3)] focus:outline-none`

### Forbidden check
- [ ] Not using `rounded-2xl`
- [ ] Not using `rounded-3xl`
- [ ] Not using `rounded-full`
- [ ] Not using `bg-gradient-to-r`
- [ ] Not using `bg-gradient-to-br`
- [ ] Not using `bg-gradient-to-b`
- [ ] Not using `shadow-lg`
- [ ] Not using `shadow-xl`

### Style rule check
- [ ] Use GitHub blue #0969da as the primary interaction color
- [ ] Use white #ffffff and light gray bg-[#f6f8fa] for backgrounds
- [ ] Use #1f2328 (dark gray) and #656d76 (secondary gray) for text
- [ ] Unify borders with border-[#d0d7de]
- [ ] Use rounded-md (6px) for consistent rounded corners

### Style drift check
- [ ] Does not violate: Do not use gradient backgrounds or colorful decorations
- [ ] Does not violate: Do not use large rounded corners rounded-2xl, rounded-full (except for avatars)
- [ ] Does not violate: Do not use heavy shadows shadow-lg, shadow-xl
- [ ] Does not violate: Do not use non-semantic decorative colors
- [ ] Does not violate: Do not use serif fonts

### Delivery check
- [ ] Responsive layout holds on phone, tablet and desktop with no horizontal overflow
- [ ] Every interactive element has a visible focus state, an accessible name and a reduced-motion path
- [ ] Text contrast meets WCAG AA and colour alone never carries state
- [ ] The result is still recognizable at a glance as GitHub Style

## Absolute Bans (Match and Refuse)

If any of the following patterns appear, it is a style violation — rewrite without exception.

- use gradient backgrounds or colorful decorations
- use large rounded corners rounded-2xl, rounded-full (except for avatars)
- use heavy shadows shadow-lg, shadow-xl
- use non-semantic decorative colors
- use serif fonts
- use oversized fonts or overly wide spacing
- use dynamic, flashy animation effects

## Self-Check (Verify Before Shipping)

If any item fails, the style has drifted — fix before shipping.

- [ ] No purple-to-blue gradients
- [ ] No overused fonts (Inter, Roboto, Geist, Fraunces, Plus Jakarta Sans)
- [ ] No nested cards (cards inside cards)
- [ ] No gray text on colored backgrounds
- [ ] Body text contrast meets WCAG AA (>= 4.5:1)
- [ ] No bounce or elastic easing curves
- [ ] Animations have a prefers-reduced-motion fallback
- [ ] Body text line length capped at 65-75 characters
- [ ] No side-stripe accent borders (border-left/right > 1px)
- [ ] No gradient text (background-clip: text)
- [ ] No glassmorphism used as the default surface treatment
- [ ] No tiny uppercase tracked eyebrow labels above every section heading
- [ ] do not use gradient backgrounds or colorful decorations
- [ ] do not use large rounded corners rounded-2xl, rounded-full (except for avatars)
- [ ] do not use heavy shadows shadow-lg, shadow-xl
- [ ] do not use non-semantic decorative colors
- [ ] do not use serif fonts

More prompt libraries: All UI Prompts · Tailwind UI Prompts · Dark Mode UI Prompts

Community

Ratings & Feedback

No ratings yet - be the firstSign in to rate

Loading comments…

Component Templates

Component Preview

按钮

GitHub 风格按钮,强调克制反馈与可访问聚焦

Frontend Readiness

Dark Mode, States, Motion, and Accessibility

This layer tracks whether the style is ready for real websites: theme modes, state feedback, keyboard access, and performance constraints.

Overall

51%

Fallback

Dark Mode

0%

Missing

UI States

79%

Partial

Motion

70%

Partial

A11y

70%

Partial

Performance

35%

Fallback

Key State Coverage

light
HoverFocus VisibleDisabledLoadingEmptyErrorSuccess

Button

Default / Hover / Focus Visible / Active / Disabled

Input

Default / Hover / Focus Visible / Disabled / Error

Card

Default / Hover / Focus Visible / Loading / Skeleton

Form

Default / Focus Visible / Disabled / Loading / Error

Implementation Notes

  • No curated dark-mode contract exists yet.
  • Check contrast in both light and dark modes.
  • Check heavy shadows, blur, large media, and scroll-linked effects manually.
  • No style-specific performance cost profile has been curated yet.

FAQ

GitHub Style — Frequently Asked Questions

What is the GitHub Style design style?
GitHub design language style with clean interface hierarchy, a refined grayscale system, blue interactive color, monospace code fonts, and developer-friendly information architecture. Its core principle: 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.
What colors does GitHub Style use?
GitHub Style uses #0969da as its primary color and #ffffff as its secondary color, with accent colors #1f883d, #9a6700, #cf222e, #1d7f98. Every hex value can be copied from the palette on this page.
How do I apply GitHub Style correctly?
Key practices: Use GitHub blue #0969da as the primary interaction color. Use white #ffffff and light gray bg-[#f6f8fa] for backgrounds. Use #1f2328 (dark gray) and #656d76 (secondary gray) for text.
What are common mistakes with GitHub Style?
Avoid: Do not use gradient backgrounds or colorful decorations. Do not use large rounded corners rounded-2xl, rounded-full (except for avatars). Do not use heavy shadows shadow-lg, shadow-xl.
How do I prompt AI to generate GitHub Style UI?
Copy the ready-made AI prompt on this page — it bundles the design tokens and component rules — and paste it into ChatGPT, Claude, Claude Code, or Codex. Effective prompts include the keywords: GitHub style, GitHub design system, Primer design system, developer tool ui.
Global Styles

Global CSS

css
/* 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;
}

IDE Integration

IDE Configuration Export

Download configuration files for AI coding assistants to generate code in this style.

Style Pack

Export Style Pack

Get complete machine-readable style assets including design tokens, Tailwind presets, CSS variables, and shadcn/ui themes.

Metadata

Style metadata including version information

Design Tokens

Compatible with Figma / Style Dictionary / Tokens Studio

Tailwind Preset

Tailwind CSS theme preset, import directly in config

Global CSS

CSS variables and base styles

shadcn Theme

shadcn/ui theme configuration

CSS Variables

Pure CSS variables, works with any project

SKILL.md

Loadable skill pack for Cursor / Claude Code / VS Code

Design Philosophy

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."

Accessibility

Accessibility Score

WCAG 2.1 compliance analysis based on color contrast and typography readability.

47

Overall Score

Grade: D - Poor

Contrast Ratios

Score: 40/100Average Ratio: 5.09:1
AA FailAAA Fail
ContextColorsRatioAAAAA
Text on background
/#1f2328 / #ffffff
15.8:1
Secondary text on background
/#656d76 / #ffffff
5.25:1
Muted text on background
/#8b949e / #ffffff
3.08:1
Text on secondary background
/#1f2328 / #f6f8fa
14.84:1
Secondary text on secondary
/#656d76 / #f6f8fa
4.93:1
Button primary
/#ffffff / #1f883d
4.52:1
Text on accent 1
/#1f2328 / #0969da
3.04:1
Alt text on accent 1
/#656d76 / #0969da
1.01:1
Text on accent 2
/#1f2328 / #1f883d
3.5:1
Alt text on accent 2
/#656d76 / #1f883d
1.16:1
Text on accent 3
/#1f2328 / #cf222e
2.95:1
Alt text on accent 3
/#656d76 / #cf222e
1.02:1

Readability

Score

63/100

Font Size

text-sm

Font Weight

font-semibold text-[#1f2328]

Line Height

default

Scoring is based on WCAG 2.1 standards. AA requires 4.5:1 contrast for normal text, 3:1 for large text; AAA requires 7:1 for normal text, 4.5:1 for large text.

Design Recipes

Recommended Combinations with GitHub Style

These curated recipes combine this style with layouts and animations, optimized for specific use cases.