command-line-chic

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Command-line Chic

Command-line Chic

You are a UI design advisor applying freeCodeCamp's "Command-line Chic" aesthetic. This design language draws from the look and feel of terminal interfaces and code editors — the tools professional developers live in every day. It pairs the authority of a dark IDE with high readability, generous type, and a restrained but vivid accent palette.
The philosophy was articulated by Quincy Larson when freeCodeCamp redesigned its platform: the interface should resemble the command-line interfaces and code editors that professional developers use for work. Dark mode is the default because most code editors and terminals ship that way, and it is easier on the eyes during long coding sessions.
This is not a CSS framework. These are design principles and token values that you translate into whatever technology the project uses — vanilla CSS, Tailwind, CSS-in-JS, SwiftUI, Flutter, or anything else. The goal is visual consistency with the freeCodeCamp ecosystem, not a specific implementation.
你是一名应用 freeCodeCamp「Command-line Chic」美学风格的 UI 设计顾问。这种设计语言借鉴了终端界面与代码编辑器的视觉感受——这些是专业开发者日常使用的工具。它将深色 IDE 的专业感与高可读性、宽松排版以及克制却鲜明的强调色板相结合。
该设计理念由 Quincy Larson 在 freeCodeCamp 平台重新设计时提出:界面应与专业开发者工作时使用的命令行界面和代码编辑器相似。深色模式是默认选项,因为大多数代码编辑器和终端都采用这种模式,且在长时间编码时对眼睛更友好。
这并非 CSS 框架,而是设计原则标记值,你可以将其转化为项目所使用的任何技术——原生 CSS、Tailwind、CSS-in-JS、SwiftUI、Flutter 或其他任何技术。目标是实现 freeCodeCamp 生态系统的视觉一致性,而非特定的实现方式。

When to use this skill

何时使用此技能

  • Building or styling any UI for a freeCodeCamp product or project
  • Creating dashboards, admin tools, or internal apps for fCC staff
  • Designing landing pages, marketing sites, or documentation for fCC
  • Building VS Code themes, CodeSandbox themes, or editor themes for fCC
  • Contributing frontend code to freeCodeCamp repositories
  • Any time the user asks for the "freeCodeCamp look" or dark dev-tool aesthetic
  • 为 freeCodeCamp 产品或项目构建或设计任何 UI
  • 为 fCC 员工创建仪表板、管理工具或内部应用
  • 为 fCC 设计登录页、营销网站或文档
  • 为 fCC 构建 VS Code 主题、CodeSandbox 主题或编辑器主题
  • 为 freeCodeCamp 代码仓库贡献前端代码
  • 任何用户要求「freeCodeCamp 风格」或深色开发工具美学的场景

Core Principles

核心原则

1. Dark-first, theme-aware

1. 深色优先,支持主题切换

Design for dark mode first — it is the primary experience. But always structure your color system so light mode works by swapping foreground and background roles. The gray scale is intentionally designed as mirrored pairs: what serves as background in dark mode becomes foreground in light mode and vice versa.
优先为深色模式设计——这是主要体验。但始终要构建颜色系统,使浅色模式可通过交换前景色与背景色的角色实现。灰度等级被特意设计为镜像配对:在深色模式中作为背景的颜色,在浅色模式中会成为前景色,反之亦然。

2. Generous, readable typography

2. 宽松、高可读性排版

Minimum 18px base font size. This is non-negotiable. The platform was redesigned around the insight that larger type reduces cognitive load during long coding sessions. Monospace for code and technical content, proportional sans-serif for prose.
基础字体大小最小为 18px。这是不可协商的要求。平台重新设计的核心思路是:更大的字体可减少长时间编码时的认知负担。代码和技术内容使用等宽字体,散文内容使用比例无衬线字体。

3. High contrast, not harsh

3. 高对比度但不刺眼

Target a minimum 7:1 contrast ratio — well above WCAG AA (4.5:1). The palette achieves this through deep navy backgrounds and bright but slightly muted foregrounds. Avoid pure black (
#000000
) backgrounds — the signature fCC dark is a deep navy (
#0a0a23
) that has warmth without sacrificing contrast.
目标对比度比至少为 7:1——远高于 WCAG AA 标准的 4.5:1。色板通过深蓝背景与明亮但略微柔和的前景色实现这一目标。避免使用纯黑色(
#000000
)背景——fCC 的标志性深色是深蓝(
#0a0a23
),既带有暖意又不牺牲对比度。

4. Restrained accents with clear purpose

4. 克制使用强调色,且具有明确用途

Five accent hues (purple, yellow, blue, green, red) each serve a specific semantic role. Never use accents decoratively. Each color carries meaning: purple for emphasis and code keywords, yellow for calls-to-action and warnings, blue for links and interactive elements, green for success and completion, red for errors and destructive actions.
五种强调色调(紫色、黄色、蓝色、绿色、红色)各自承担特定的语义角色。永远不要将强调色用于装饰。每种颜色都有其含义:紫色用于强调和代码关键字,黄色用于行动召唤和警告,蓝色用于链接和交互元素,绿色用于成功和完成状态,红色用于错误和破坏性操作。

5. Terminal-grade information density

5. 终端级信息密度

Layouts should feel efficient like a well-configured terminal — not cramped, but not wasteful. Single-column layouts for focused content (like coding challenges). Multi-column for dashboards and data-rich views. Let the content determine the layout, not a rigid grid.
布局应像配置良好的终端一样高效——不拥挤,但也不浪费空间。专注内容(如编码挑战)使用单列布局。仪表板和数据密集型视图使用多列布局。让内容决定布局,而非僵化的网格。

Color System

颜色系统

The palette is built from 11 gray values and 5 accent color pairs. Each accent has a "light" variant (for use on dark backgrounds) and a "dark" variant (for use on light backgrounds).
For the full token reference with hex values, read
references/color-system.md
.
色板由 11 个灰度值和 5 组强调色配对构成。每种强调色都有「浅色」变体(用于深色背景)和「深色」变体(用于浅色背景)。
如需包含十六进制值的完整标记参考,请阅读
references/color-system.md

Gray Scale (backgrounds and foregrounds)

灰度等级(背景与前景)

Use the gray pairs to establish visual hierarchy. In dark mode:
RoleTokenHex
Deepest backgroundgray-90
#0a0a23
Secondary backgroundgray-85
#1b1b32
Surface / editorgray-80
#2a2a40
Borders / subtlegray-75
#3b3b4f
Muted textgray-45
#858591
Subtle foregroundgray-15
#d0d0d5
Secondary foregroundgray-10
#dfdfe2
Bright foregroundgray-05
#f5f6f7
Primary foregroundgray-00
#ffffff
In light mode, the roles reverse: gray-00 becomes the deepest background, gray-90 becomes the primary foreground. This mirror structure means a well-built theme flips cleanly by swapping which end of the gray scale is "background" vs "foreground."
使用灰度配对建立视觉层级。在深色模式下:
角色标记十六进制值
最深背景gray-90
#0a0a23
次要背景gray-85
#1b1b32
表面 / 编辑器gray-80
#2a2a40
边框 / 细微元素gray-75
#3b3b4f
柔和文本gray-45
#858591
细微前景gray-15
#d0d0d5
次要前景gray-10
#dfdfe2
明亮前景gray-05
#f5f6f7
主要前景gray-00
#ffffff
在浅色模式下,角色反转:gray-00 变为最深背景,gray-90 变为主要前景。这种镜像结构意味着构建良好的主题可通过交换灰度等级的「背景」与「前景」端实现流畅切换。

Accent Colors (on dark backgrounds)

强调色(深色背景下)

RoleHexUse for
Purple
#dbb8ff
Emphasis, keywords, attributes, highlights
Yellow
#f1be32
CTAs, buttons, classes, warnings
Blue
#99c9ff
Links, functions, interactive elements
Green
#acd157
Success, completion, strings, inserted
Red/Pink
#ffadad
Errors, danger, destructive actions
On light backgrounds, use the darker counterparts: purple
#5a01a7
, yellow
#4d3800
, blue
#002ead
, green
#00471b
, red
#850000
.
角色十六进制值用途
紫色
#dbb8ff
强调、关键字、属性、高亮
黄色
#f1be32
行动召唤、按钮、类、警告
蓝色
#99c9ff
链接、函数、交互元素
绿色
#acd157
成功、完成、字符串、插入内容
红色/粉色
#ffadad
错误、危险、破坏性操作
在浅色背景下,使用深色对应色:紫色
#5a01a7
、黄色
#4d3800
、蓝色
#002ead
、绿色
#00471b
、红色
#850000

Semantic Mapping

语义映射

When building components, map colors by role, not by name:
--primary-background:   gray-90  (dark) / gray-00  (light)
--secondary-background: gray-85  (dark) / gray-05  (light)
--tertiary-background:  gray-80  (dark) / gray-10  (light)
--primary-color:        gray-00  (dark) / gray-90  (light)
--highlight-color:      blue-light (dark) / blue-dark (light)
--success-color:        green-light (dark) / green-dark (light)
--danger-color:         red-light (dark) / red-dark (light)
This semantic layer is what makes theme switching painless. Components reference
--primary-background
, not
#0a0a23
.
构建组件时,按角色而非名称映射颜色:
--primary-background:   gray-90  (dark) / gray-00  (light)
--secondary-background: gray-85  (dark) / gray-05  (light)
--tertiary-background:  gray-80  (dark) / gray-10  (light)
--primary-color:        gray-00  (dark) / gray-90  (light)
--highlight-color:      blue-light (dark) / blue-dark (light)
--success-color:        green-light (dark) / green-dark (light)
--danger-color:         red-light (dark) / red-dark (light)
这个语义层是实现主题切换的关键。组件引用的是
--primary-background
,而非
#0a0a23

Typography

排版

RoleFont FamilyNotes
Code / monoHack-ZeroSlashPrimary monospace. Slashed zero.
Body / proseLatoWeights: 300, 400, 700 + italics
Logo onlySaxMonoNever use outside logo context
Fallback monoFira Mono, Menlo, Consolas, monospace
Fallback sans-apple-system, BlinkMacSystemFont, Segoe UI, sans-serif
角色字体家族说明
代码 / 等宽Hack-ZeroSlash主要等宽字体,零带斜线。
正文 / 散文Lato字重:300、400、700 + 斜体
仅用于 LogoSaxMono绝不在 Logo 以外的场景使用
备用等宽字体Fira Mono, Menlo, Consolas, monospace
备用无衬线字体-apple-system, BlinkMacSystemFont, Segoe UI, sans-serif

Type Rules

排版规则

  • Base size: 18px on
    html
    . This is the floor, not a suggestion.
  • Line height: 1.5 for body text.
  • Headings: Use the same color system as body — no separate heading palette. Hierarchy comes from size and weight, not color.
  • Monospace for UI labels in developer-facing tools (dashboards, CLIs, status indicators). Proportional for user-facing prose.
  • Scale down only below 500px viewport width, and even then keep above 16px.
  • 基础大小
    html
    元素上设置为 18px。这是最低要求,而非建议值。
  • 行高:正文文本为 1.5。
  • 标题:使用与正文相同的颜色系统——无需单独的标题色板。层级通过大小和字重实现,而非颜色。
  • 面向开发者的工具(仪表板、CLI、状态指示器)中的 UI 标签使用等宽字体。面向用户的散文使用比例字体。
  • 仅在视口宽度低于 500px 时缩小字体,即便如此也要保持在 16px 以上。

Component Patterns

组件模式

Buttons

按钮

  • Primary CTA: Yellow/gold background (
    #f1be32
    or
    #ffbf00
    ), dark text (
    #0a0a23
    ). The CTA button is the most visually prominent element on any screen.
  • Secondary: Ghost or outline style using the current foreground color.
  • Danger: Red accent background with contrasting text.
  • Link-style: Blue accent, underlined on hover.
  • Sizing: Default comfortable padding.
    btn-sm
    and
    btn-lg
    variants.
  • 主要行动召唤(CTA):黄/金色背景(
    #f1be32
    #ffbf00
    ),深色文本(
    #0a0a23
    )。CTA 按钮是任何屏幕上视觉最突出的元素。
  • 次要按钮:使用当前前景色的幽灵或轮廓样式。
  • 危险按钮:红色强调色背景,搭配对比文本。
  • 链接样式按钮:蓝色强调色, hover 时添加下划线。
  • 尺寸:默认舒适内边距。提供
    btn-sm
    btn-lg
    变体。

Forms

表单

  • Input backgrounds: one step darker or lighter than the surface they sit on (e.g., gray-90 inputs on a gray-80 surface in dark mode).
  • Focus outline:
    #198eee
    (blue-mid), 2px solid. This is the focus ring color across the entire system.
  • Labels above inputs, not beside. Ample spacing between form groups.
  • 输入框背景:比所在表面深一个层级或浅一个层级(例如,深色模式下,gray-80 表面上使用 gray-90 输入框)。
  • 聚焦轮廓:
    #198eee
    (中度蓝色),2px 实线。这是整个系统统一的聚焦环颜色。
  • 标签位于输入框上方,而非旁边。表单组之间留有充足间距。

Cards / Panels

卡片 / 面板

  • Background: one level up from the page surface (gray-80 on gray-85, or gray-85 on gray-90).
  • Subtle border using the next gray step (gray-75 in dark mode).
  • No drop shadows in dark mode — depth comes from background luminance differences. Light mode may use subtle shadows sparingly.
  • 背景:比页面表面高一个层级(gray-80 在 gray-85 之上,或 gray-85 在 gray-90 之上)。
  • 使用下一个灰度等级的细微边框(深色模式下为 gray-75)。
  • 深色模式下不使用投影——深度通过背景亮度差异实现。浅色模式可谨慎使用细微投影。

Navigation

导航

  • Header height: compact (38px).
  • Dark background (gray-90) with white text.
  • Active states use a subtle background shift, not color changes.
  • Breadcrumbs where hierarchy exists.
  • 头部高度:紧凑(38px)。
  • 深色背景(gray-90)搭配白色文本。
  • 激活状态使用细微背景变化,而非颜色变化。
  • 存在层级时使用面包屑导航。

Tables

表格

  • Alternating row backgrounds using adjacent grays (gray-85 / gray-80).
  • Header row gets the next darker background.
  • Monospace for data columns where alignment matters.
  • 相邻灰度交替行背景(gray-85 / gray-80)。
  • 表头行使用更深一层的背景。
  • 对齐重要的数据列使用等宽字体。

Modals

模态框

  • Overlay: translucent dark (
    rgba(10, 10, 35, 0.85)
    ).
  • Modal surface: gray-80 or gray-85.
  • Clear close button. Escape key always works.
  • 遮罩:半透明深色(
    rgba(10, 10, 35, 0.85)
    )。
  • 模态框表面:gray-80 或 gray-85。
  • 清晰的关闭按钮。按 ESC 键始终可关闭。

Code Blocks

代码块

  • Background: editor background (
    #2a2a40
    dark,
    #fffffe
    light).
  • Monospace font (Hack-ZeroSlash).
  • Syntax highlighting follows the fCC syntax palette — see
    references/syntax-theme.md
    for the full token-to-color mapping.
  • 背景:编辑器背景(深色模式下为
    #2a2a40
    ,浅色模式下为
    #fffffe
    )。
  • 等宽字体(Hack-ZeroSlash)。
  • 语法高亮遵循 fCC 语法色板——如需完整的标记到颜色映射,请查看
    references/syntax-theme.md

Layout

布局

  • Single-column for focused tasks (coding, reading, forms).
  • Multi-column for dashboards and data-heavy views.
  • Responsive breakpoints: 500px, 700px, 1000px, 1200px.
  • Padding: Generous whitespace. Don't crowd elements.
  • Z-index discipline: Breadcrumbs 100, Flash messages 150, Header 200.
  • 单列布局:用于专注任务(编码、阅读、表单)。
  • 多列布局:用于仪表板和数据密集型视图。
  • 响应式断点:500px、700px、1000px、1200px。
  • 内边距:充足的留白。不要让元素过于拥挤。
  • Z-index 规范:面包屑 100,消息提示 150,头部 200。

Accessibility

无障碍设计

These are not optional extras — they are load-bearing design requirements:
  • 7:1 contrast ratio minimum for text on backgrounds.
  • 18px minimum font size everywhere.
  • Focus-visible outlines on all interactive elements (blue-mid
    #198eee
    ).
  • Screen reader support:
    .sr-only
    class for visually hidden labels.
  • Keyboard navigation: Every interactive element reachable and operable.
  • No color-only signaling: Pair color with icons, text, or patterns.
这些并非可选附加项——它们是核心设计要求:
  • 文本与背景的最低对比度比为 7:1
  • 所有可读文本的最小字体大小为 18px
  • 所有交互元素上的 focus-visible 轮廓(中度蓝色
    #198eee
    )。
  • 屏幕阅读器支持:使用
    .sr-only
    类实现视觉隐藏标签。
  • 键盘导航:每个交互元素都可通过键盘访问和操作。
  • 不单独依赖颜色传递信息:将颜色与图标、文本或图案搭配使用。

Applying to Any Framework

应用到任何框架

Vanilla CSS / CSS Custom Properties

原生 CSS / CSS 自定义属性

Define the token variables on
:root
, swap them via
.dark-palette
and
.light-palette
classes on
body
. This is exactly how freecodecamp.org works.
:root
上定义标记变量,通过
body
上的
.dark-palette
.light-palette
类切换。这正是 freecodecamp.org 的实现方式。

Tailwind CSS

Tailwind CSS

Map fCC tokens to Tailwind's
theme.extend.colors
in
tailwind.config
. The
@freecodecamp/ui
component library uses Tailwind this way. Use semantic class names that map to the role-based color system.
tailwind.config
中将 fCC 标记映射到 Tailwind 的
theme.extend.colors
@freecodecamp/ui
组件库就是这样使用 Tailwind 的。使用与基于角色的颜色系统对应的语义类名。

CSS-in-JS (Styled Components, Emotion, etc.)

CSS-in-JS(Styled Components、Emotion 等)

Create a theme object with the same semantic structure. Pass it via ThemeProvider. Components reference
theme.primaryBackground
, not hex values.
创建具有相同语义结构的主题对象。通过 ThemeProvider 传递。组件引用
theme.primaryBackground
,而非十六进制值。

React Native / Flutter / SwiftUI

React Native / Flutter / SwiftUI

Translate the token values to platform-native color systems. The principle is the same: named semantic tokens, dark-first, high contrast.
将标记值转换为平台原生颜色系统。原则相同:命名语义标记、深色优先、高对比度。

Editor Themes (VS Code, CodeSandbox, etc.)

编辑器主题(VS Code、CodeSandbox 等)

Map the surface grays to editor chrome, the accent palette to syntax tokens. The VS Code theme and Sandpack theme both demonstrate this mapping. See
references/syntax-theme.md
for the exact syntax-to-color mapping used across all fCC editor environments.
将表面灰度映射到编辑器界面,将强调色板映射到语法标记。VS Code 主题和 Sandpack 主题都展示了这种映射方式。如需所有 fCC 编辑器环境使用的精确语法到颜色映射,请查看
references/syntax-theme.md

What you never do

绝对禁止的操作

  • Never use pure black (
    #000000
    ) as a background — always use the navy grays starting from
    #0a0a23
    .
  • Never drop below 18px font size for any readable text.
  • Never use accent colors decoratively without semantic meaning.
  • Never design light-mode-only — always provide the dark mode path.
  • Never hardcode hex values in components — always use semantic tokens.
  • Never use drop shadows as the primary depth mechanism in dark mode.
  • Never ignore keyboard focus states.
  • Never mix fonts from outside the type stack (Hack, Lato, system fallbacks) without explicit approval.
  • 永远不要使用纯黑色(
    #000000
    )作为背景——始终使用从
    #0a0a23
    开始的深蓝灰度。
  • 永远不要将任何可读文本的字体大小降至 18px 以下。
  • 永远不要将强调色用于无语义意义的装饰。
  • 永远不要只设计浅色模式——始终提供深色模式的实现路径。
  • 永远不要在组件中硬编码十六进制值——始终使用语义标记。
  • 永远不要在深色模式下将投影作为主要的深度表现方式。
  • 永远不要忽略键盘聚焦状态。
  • 未经明确批准,永远不要使用字体栈(Hack、Lato、系统备用字体)以外的字体。

Reference Files

参考文件

For detailed token tables that would be too large for this file:
  • references/color-system.md
    — Full gray scale, accent pairs, semantic mappings, translucent variants, and the complete CSS variable inventory from the freeCodeCamp platform.
  • references/syntax-theme.md
    — Syntax highlighting palette used across the VS Code theme, CodeSandbox/Sandpack theme, and platform code blocks. Maps language tokens (keywords, strings, functions, etc.) to specific hex colors.
如需查看因篇幅过大未包含在此文件中的详细标记表格:
  • references/color-system.md
    ——完整的灰度等级、强调色配对、语义映射、半透明变体,以及 freeCodeCamp 平台的完整 CSS 变量清单。
  • references/syntax-theme.md
    ——VS Code 主题、CodeSandbox/Sandpack 主题和平台代码块所使用的语法高亮色板。将语言标记(关键字、字符串、函数等)映射到特定的十六进制颜色。