lib/design_system/. Changes land there; these docs mirror it.
Adding a color token
1
Decide the layer
New primitive shade? →
reference_colors.dart. New purpose? → a semantic token in semantic_colors.dart referencing existing primitives. Persona-dependent? → a field on AccentColors.2
Update all the places
For
DesignSystemColors: the field, the constructor, .light, .dark, copyWith, and lerp. A token missing from lerp snaps instead of animating on theme changes.3
Wire Material if relevant
If stock Material widgets should use it, add it to the component themes in
app_theme.dart (see Material bridge).4
Document it
Add the token to the Semantic Colors (or relevant) page with its light/dark mapping.
Adding a typography token
Same drill intypography.dart: field + constructor + base + copyWith + lerp (colors come from light/dark via the blanket copyWith). Stick to the 5-category × 3-size grid — a new size within a category beats a new one-off style.
Adding an icon
- Drop the SVG in
assets/icons/(subfolders likeactivities/,personas/are fine). - Register it in the
AshIconsenum inash_icon.dart— the enum value’s string is the path fragment:myIcon('MyIcon')→assets/icons/MyIcon.svg. - Prefer Material Symbols for generic glyphs —
AshIconsis for artwork that’s ours.
Adding a component
- Location: foundational UI →
lib/design_system/components/+ export fromdesign_system.dart; feature-specific reusable →lib/widgets/common/. - Naming:
Styled*for Material wrappers,Ash*for brand primitives. - Variants: private enum + named constructors (the pattern).
- Tokens only: all colors/text via
context.colorTheme/context.textTheme. - Stateless unless it genuinely needs local state; no Riverpod in the design system.
- Accessibility: composite tappables wrapped in
SemanticButton; decorative icons unlabeled. - Doc comments: every public class and non-obvious parameter — doc comments are where these pages come from.
- Docs: add a component page here following the shared template (purpose → variants → API table → tokens → example → source link).
Versioning & changelog
Sundial is versioned as a system — the navbar version on this site tracks the design system as it ships in the app, not the docs. When you change the system:- Add an
<Update>entry to the Changelog describing the change, dated, with the PR link. - Bump the version when the change warrants it:
- Major — breaking renames or removals of tokens/components, palette restructuring
- Minor — new tokens, new components, new component variants
- Patch — value tweaks (a hex adjustment, a radius change), bug fixes
- Update the navbar badge — the
v…link indocs.json’snavbar.linksis set by hand; keep it matching the newest changelog entry.