DESIGN.md
以开放的 DESIGN.md 格式呈现 Sunbeam:任何读取该格式的 Agent 或设计工具都能使用其中的 token 和指引。它与本站使用同一份 token 文件生成。
文件
一个 Markdown 文件:开头是 token,正文按格式规定的顺序分成八节。每次构建本站时都会用官方 linter 检查。
AstraFoundry's design system: warm paper and ink, one vivid yellow for the single action or result, motion-blurred natural photographs under one solid focus surface, concentric corners, and motion that plays once and rests.
npx @google/design.md lint DESIGN.md
0 个错误,0 个警告
- Design system defines 76 colors, 9 typography scales, 13 rounding levels, 6 spacing tokens, 49 components.
curl -fsSL https://astrafoundry.si/design.md -o DESIGN.md颜色
文件中每个语义颜色都有对应的 dark- 版本。这里两者共用一个色块:左亮右暗。选中色块即可复制它的引用。
黄色
墨色
Substrate,两种模式相同
组件
文件中的组件配方,按各自的 token 绘制。带文字的表面会显示对比度,全部达到 WCAG AA。
左为亮色,右为暗色。
线、点和填充
- text-field-border
- divider
- focus-ring
- figure-line
- status-success
- status-danger
- status-info
- canvas-dot
- photo-scrim
- image-outline
- backdrop-chip
- backdrop-chip-labelAa
- backdrop-captionAa
- stage-line
- stage-edge
字体、形状与间距
字体、圆角和间距 token,各按其数值绘制。
字体
- headline-display96px / 0.98 · 400 · -0.03em暖墨与一抹黄
- headline-lg48px / 1.05 · 400 · -0.02em暖墨与一抹黄
- headline-md24px / 1.3 · 500 · -0.01em暖墨与一抹黄
- body-lg18px / 1.6 · 400暖墨与一抹黄
- body-md16px / 1.6 · 400暖墨与一抹黄
- body-sm14px / 1.5 · 400暖墨与一抹黄
- label-md14px / 1.5 · 500暖墨与一抹黄
- caption13px / 1.4 · 400暖墨与一抹黄
- code-md14px / 1.6 · 400暖墨与一抹黄
圆角
间距
- unit4px
- hairline1px
- tile-inset8px
- card-inset-sm24px
- card-inset-md40px
- card-inset-lg56px
文档
按 Agent 读取的方式查看指引,或查看文件原文。
Overview
Sunbeam is AstraFoundry's design system, used by astrafoundry.si, Lyra, Arion and Telo. It should feel calm, warm and exact: a product that does real work and shows it plainly.
- Warm ink, one yellow. Neutrals are warm ink.
colors.primarymarks the one primary action on a screen or the result of a scene, and nothing else. - Photographs, not gradients. Atmosphere comes from motion-blurred natural photographs, never from gradients, glows or noise.
- One solid focus. On a photograph exactly one surface is solid; everything around it is tinted, muted or cut off by the edge.
- Concentric corners. A rounded thing inside a rounded thing uses inner radius = outer radius − inset.
- Motion explains, then rests. A scene plays once when it is seen, shows action then result, and stops on the result.
The full specification, with feature tiles, 3D demonstration figures and a review checklist, is the Sunbeam agent skill at https://astrafoundry.si/design/skill.
Colors
Light mode is the default. Every semantic color has a dark- twin, and every component that changes in dark mode has a -dark variant; the twin aliases the light value where dark mode keeps it. Switch the whole set at once, never per component.
- Ramps. Two ramps carry every other color: yellow (
colors.yellow-100,colors.yellow-300,colors.yellow-500,colors.yellow-700) and warm ink (colors.ink-50,colors.ink-100,colors.ink-200,colors.ink-300,colors.ink-400,colors.ink-500,colors.ink-700,colors.ink-800,colors.ink-900). Use the semantic names below, not the ramps. - Paper and ink.
colors.backgroundis warm paper,colors.foregroundwarm ink.colors.cardis solid content: panels, windows, mock product UI. - Yellow.
colors.primaryfills the single primary action and marks a result;colors.ringis the focus ring.colors.accentwithcolors.accent-foregroundis a quiet highlight, used sparingly. - Quiet.
colors.secondaryandcolors.mutedfill wells and secondary controls;colors.muted-foregroundcarries leads and captions.colors.borderandcolors.inputare 1px hairlines;colors.faintis the outline of drawn figures. - Status.
colors.success,colors.dangerandcolors.infocolor icons and dots only, never running text. - Substrate.
colors.substrateand its family are an always-dark backstage that does not change with the theme: behind demos, and for everything set on a photograph.colors.substrate-focusis the solid focus surface, white in both modes, withcolors.substrate-focus-ink.colors.substrate-tintis the translucent chip beside it. - Scrim.
colors.scrimat up to 55% opacity, fading to transparent, is the only gradient, and only behind text on a photograph.
Never write physical colors in components, never use yellow for borders, badges or links, and never color a shadow.
Typography
Fraunces for display, IBM Plex Sans for everything else, JetBrains Mono for code. Chinese and Japanese fall back to system faces (PingFang SC, Hiragino, Noto) and use no tracking on headings.
- Headlines.
typography.headline-displayandtypography.headline-lgare Fraunces at weight 400, for page and section titles only. Never bold, never italic for emphasis. The display size scales with the viewport from 48px to 96px. - Headings and body.
typography.headline-mdheads blocks;typography.body-lgis a lead incolors.muted-foreground;typography.body-mdis running text;typography.body-smis dense UI. - Labels and captions.
typography.label-mdfor buttons and controls,typography.captionfor captions. Nothing is set below 12px. - Numbers that change or line up use tabular figures. Titles are balanced, paragraphs pretty, at most about 65 characters a line. Sentence case, no exclamation marks, no emoji.
Layout
Sizes come in steps of spacing.unit. Lines are spacing.hairline: separate cells with a one-pixel gap over colors.border rather than borders on each cell, so lines never double and corners never break.
A backdrop card keeps one inset for every zone: spacing.card-inset-sm on phones, spacing.card-inset-md from 640px, spacing.card-inset-lg from 1024px. The mark sits top-left at the inset, the focus row near the vertical middle, a status line under the focus surface, and the caption bottom-left at the same inset as the mark. Nothing is centered by default; compositions read left to right, top to bottom.
A feature tile insets its art panel by spacing.tile-inset.
Elevation & Depth
Depth comes from warm, two-layer shadows keyed off ink rather than neutral black: a one-pixel contact shadow and a soft spread below it, stronger in dark mode. Five levels: 1 for controls and chips, 2 for popovers, 3 for raised cards, 4 for dialogs, 5 for a window or the focus surface floating on a photograph.
No glass: no backdrop blur, no outer glows, no colored or gradient borders. A photograph is used as it is, without a tint, blur or vignette; choose a darker photograph rather than darkening a bright one.
Shapes
Corners are soft and concentric. The scale runs from rounded.none, rounded.xs and rounded.sm for marks and code to rounded.3xl for cards; controls and chips are rounded.full pills. Feature-tile grids use rounded.tile; stage and backdrop cards use rounded.3xl below 1024px and rounded.stage above.
Inner radius = outer radius − inset: a rounded.tile card with an 8px inset holds a 20px panel. When the inset is larger than the outer radius, the inner element keeps its own radius.
Components
The component tokens are recipes: color pairs, type and shape for the parts every Sunbeam page uses. Hairline and dot entries (divider, text-field-border, focus-ring, canvas-dot, figure-line, stage-line, stage-edge, image-outline) give the color of a line or dot of that size.
- Buttons.
button-primaryis the one yellow action on a screen; everything else isbutton-secondaryor a quiet text button. Pressing scales to 0.97 over 150ms. - Cards and popovers.
cardholds solid content;popoverfloats on shadow level 2. - Fields.
text-fieldis a solid field with atext-field-borderhairline and afocus-ringon keyboard focus. - Backdrop card.
backdrop-cardis a motion-blurred natural photograph (oncolors.substrateuntil it loads) with onebackdrop-focussurface,backdrop-chipneighbors that may bleed off the edges, and abackdrop-caption. Because the photograph does not change with the theme, these components have no dark variant. - Stage.
stage-panelandstage-raisedbuild mock product UI on the dark substrate. - Feature tiles and figures. Animated feature tiles and live 3D demonstration figures follow the Sunbeam skill, sections 6 and 7.
Motion
Four curves: ease-out cubic-bezier(.22, 1, .36, 1) for anything entering or moving, a spring cubic-bezier(.34, 1.4, .64, 1) for small things appearing, ease-in-out cubic-bezier(.65, 0, .35, 1) for something already on screen changing shape, and a drawer curve cubic-bezier(.32, .72, 0, 1). 150ms for hover and press, 200–300ms for popovers, 250–600ms per move, under about 3s per scene. Exits are faster than entrances. Animate transform, opacity and filter only. With reduced motion, show the final frame.
Do's and Don'ts
- Do set a card on a motion-blurred natural photograph; don't fill it with an indigo-to-violet gradient or a glow.
- Do make one surface solid and quiet the rest with tint; don't frost every element with glass blur.
- Do set captions in muted light ink at the card inset, bottom left; don't center bold white text with a drop shadow.
- Do use inner radius = outer radius − inset; don't give nested elements the radius of their container.
- Do spend yellow on the one primary action or result; don't use it for badges, borders, icons and links at once.
- Do play a scene once when it is seen and rest on the result; don't loop, bounce or pulse forever.
- Do show a real object as shaded solids with one part lit; don't draw a wireframe, or a glossy render with labels and arrows.
- Do keep WCAG AA contrast (4.5:1) for text; don't set status colors as running text.
