DESIGN.md
This document defines Cherry Studio's product-wide visual direction and the rules for choosing shared design semantics. It is intentionally not a component API reference, a copy of Tailwind classes, or a specification for individual feature pages.
@cherrystudio/ui components own exact variants, dimensions, interaction states,
motion, and accessibility behavior.If this document conflicts with an implementation detail, use the relevant source above and update this document only when the product-wide design intent has changed.
Cherry Studio is a content-first AI workspace. The interface should feel calm, precise, and utilitarian so that conversation, code, documents, and user-created content remain the visual focus.
The shared direction is:
@cherrystudio/ui primitives and composites instead of recreating their appearance or
interaction locally.Keep a rule in DESIGN.md only when it applies across unrelated product areas and is expected to remain stable as
individual components evolve. Examples include semantic color usage, depth philosophy, focus visibility, and the
preference for shared components.
Exact height, padding, radius, animation timing, portal behavior, and variant styling belong in the component implementation. Stories should make supported variants and composition visible. Do not duplicate those values in this document or create a parallel component specification that must be synchronized manually.
When a shared component cannot express a required behavior, improve its public API after confirming that the need is reusable. Do not establish a second page-local version through documentation.
Individual pages choose layouts that fit their tasks. A page-specific column width, toolbar arrangement, card grid, or content flow is not a design-system rule. Keep such decisions close to the feature when they need explanation.
Promote a pattern only after it is reused across independent product areas and has a stable shared implementation. The reusable component then owns its exact layout; this document may describe only the cross-product principle it represents.
Use semantic Tailwind utilities in component code and the corresponding public CSS variables in authored CSS. The variable catalog is the complete reference.
| Intent | Preferred roles |
|---|---|
| Page and work surface | background, background-subtle |
| Contained surface | card, card-foreground |
| Floating surface | popover, popover-foreground |
| Primary and secondary text | foreground, muted-foreground |
| Quiet and unavailable content | foreground-tertiary, foreground-disabled |
| Primary action or selection | primary, primary-foreground |
| Dangerous action | destructive, destructive-foreground |
| Feedback | success, warning, info, error families |
| Structure and selection | border, border-subtle, border-strong, border-selected, input, ring |
| Navigation zone | sidebar family |
| Clickable text | link |
| Categorical data | chart-1 through chart-5 |
bg-error-subtle text-error-subtle-foreground border-error-border.link for clickable text. Do not treat primary as a generic blue or decorative accent.destructive for dangerous actions; use the error family for error feedback.chart-1 through chart-5 for ordinary categorical charts. Primitive color scales require an intentionally
reviewed visualization palette.Do not hard-code hex, rgb, rgba, or oklch values in product UI. Do not declare or consume generated
--color-* variables in authored code. Shared --cs-* variables are internal providers, not component-facing
semantics. Follow the token architecture when adding or changing a public role.
Use the shared body and heading font families for functional UI. Code-rendering components own their monospace stack locally.
The canonical values live in packages/ui/src/styles/tokens/typography.css; this document does not duplicate the
scale.
Use surface color as the primary depth system:
background is the ground plane.card contains related content.popover is reserved for transient floating content.sidebar defines a distinct navigation zone.Borders separate adjacent surfaces when color alone is insufficient. Shadows are for floating elements and intentional interaction feedback, not routine static elevation. Use the shared overlay and floating primitives; do not invent page-local glass, scrim, or blur tokens.
Use the radius and spacing utilities supplied by the shared Tailwind theme. Let shared components own their shape.
For custom composition, choose a radius according to scale and density: compact controls use smaller shared radii,
containers use larger ones, and rounded-full is limited to pills, avatars, and circular controls.
Keyboard focus must be visible and should reuse a component's existing border, fill, text, underline, or an inset indicator. Avoid adding a second frame outside the control.
Pointer focus, an open popup, or a pressed control does not automatically justify a theme-colored border. Persistent states such as selected, checked, active, and invalid may use a border when it communicates that state.
Prefer the loading, disabled, invalid, selected, and open states already exposed by shared components. Motion should
explain a state or spatial transition, remain restrained, and respect prefers-reduced-motion. Do not introduce
page-local motion that competes with content or contradicts the shared component behavior.
Use Tailwind's numeric spacing scale and standard breakpoints. Layout should respond to available space and content priority rather than following a universal page template.
A repeated layout should become a shared component or composition API. Documentation alone does not make a page-specific layout a design-system pattern.
Before shipping new UI, check that it:
@cherrystudio/ui for available primitives and composites;