Skip to main content

Foundations

The official Astryx color, type, spacing, radius, elevation, and motion foundations.
2 min read

Agata adopts the Astryx token catalog directly. Astryx Neutral supplies values; Agata does not maintain a parallel palette or scale.

Color#

Use semantic color tokens before categorical ones:

FamilyExamplesUse
Surfaces--color-background-body, --color-background-surface, --color-background-card, --color-background-popoverPage and elevated surfaces
Content--color-text-primary, --color-text-secondary, --color-icon-primary, --color-icon-secondaryText and icons
Accent--color-accent, --color-accent-muted, --color-on-accentActions, selection, and app identity
Borders--color-border, --color-border-emphasizedSeparators and stronger outlines
Status--color-success, --color-warning, --color-error and their muted/on-color partnersProduct state
Categorical--color-background-*, --color-border-*, --color-icon-*, --color-text-*Data and domain distinctions

Do not introduce raw neutral ramps or feature-owned status variables.

Typography#

Use Astryx Text and Heading semantic props first. StyleX leftovers use:

  • typographyVars: body, heading, and code font families.
  • textSizeVars: --font-size-4xs through --font-size-5xl.
  • fontWeightVars: normal, medium, semibold, and bold.
  • typeScaleVars: semantic heading, body, supporting, label, and code sizes, weights, and line heights.

The base body size is --font-size-base (14px). Product code does not own a second type scale.

Spacing and element size#

spacingVars is a 4px-based scale from --spacing-0 through --spacing-12, including the 2px and 6px half steps. Prefer Astryx layout props (gap, padding, Stack, Layout, FormLayout) over consuming the variables manually.

sizeVars defines the official control heights:

TokenValueProduct default
--size-element-sm28pxC2 default via SizeProvider
--size-element-md32pxExplicit size="md" only
--size-element-lg36pxExplicit size="lg" (marketing CTAs)

Borders and focus#

borderVars['--border-width'] is the standard border width. Visible keyboard focus comes from focusVars; do not create an Agata ring or focus-shadow token.

Radii#

Use the radius for the role, not an arbitrary size:

TokenRole
--radius-noneSquare geometry
--radius-innerNested details
--radius-elementControls
--radius-containerCards and grouped surfaces
--radius-pageLarge page surfaces
--radius-chatChat surfaces
--radius-fullPills and circles

Elevation#

Use --shadow-low, --shadow-med, or --shadow-high for outer elevation. Input interaction and validation use the official --shadow-inset-* tokens.

Motion#

Use durationVars (fast, medium, and slow, each with min/default/max) and easeVars['--ease-standard']. Motion must communicate state or spatial continuity; do not add a second duration or easing scale.

Layout measurements and safe areas#

Breakpoints, page ceilings, sidebar widths, reading measure, and safe-area insets are layout contracts rather than Astryx design tokens. Keep them local to the owning layout or integration. Use env(safe-area-inset-*, 0px) directly where needed.