This document captures development workflow, historical context, and lessons learned while working on the GoA Design System website. For comprehensive AI guidance, see AI_INSTRUCTIONS.md.
- Home: Landing page with key resources and navigation
- Get Started: Onboarding for designers, developers, QA testers
- Foundations: Design principles, accessibility, branding, content guidelines
- Examples: Common patterns and implementations (requires manual review for changes)
- Components: Interactive component documentation (requires manual review for changes)
- Design Tokens: Color, spacing, typography tokens
- Built with React + Vite
- Uses
@abgov/react-componentsv6.6.1 and@abgov/web-componentsv1.36.1 - React Router for navigation with nested routes
- ComponentContent wrapper for consistent page structure
- Original System: GoabText had some default margins
- v6 Migration Period: Temporarily changed to
mt="none"andmb="none"defaults, requiring explicit margins - Current System: GoabText now has intelligent size-based default margins that provide good starting values
- Defaults-first approach: GoabText has built-in margins based on text size
- Override when needed: Use
mt="none"ormb="none"to connect related content - Semantic HTML required: Always use
tagprop for proper heading hierarchy
- Component prefixes changed:
GoA→Goab(React),goa-→goab-(Angular) - Margin properties changed from
stringtype toSpacingtype - Evolution from explicit margins to intelligent defaults
// Standard page pattern - trust defaults, override relationships
<GoabText tag="h1" size="heading-xl">Page Title</GoabText>
<GoabText size="body-l" mt="none">Introduction text</GoabText>
// Pages with category labels
<GoabText size="heading-m">Content guidelines</GoabText>
<GoabText tag="h1" size="heading-xl" mt="none">Page Title</GoabText>
<GoabText size="body-l" mt="none">Introduction text</GoabText>
// Always use semantic tags for accessibility
<GoabText tag="h2" size="heading-m">Section Heading</GoabText>- Trust the defaults - GoabText provides good spacing automatically
- Override for relationships - Use
mt="none"to connect related content - Semantic HTML always - Use
tag="h1",tag="h2", etc. for accessibility - Container boundaries - Consider edge alignment with
mt="none"ormb="none"
heading-xl: Main page titlesbody-l: Page introductions and important paragraphsheading-m: Section headingsbody-m: Regular content
ComponentContent: Wrapper with table of contents supportGoabDivider: Section separators with consistent marginsCardLite: Reusable cards for navigation (Foundations, Examples, Components, Design tokens)AccessibilityEmpty: Common accessibility guidance component used on component pages- Located at:
src/components/empty-states/accessibility-empty/AccessibilityEmpty.tsx - Contains two GoabText elements with specific spacing requirements
- Located at:
src/routes/
├── home.tsx
├── get-started/
│ ├── GetStartedLayout.tsx
│ ├── GetStartedOverview.tsx
│ ├── designers/
│ ├── developers/
│ └── [other pages]
├── foundations/
├── examples/ (excluded from systematic changes)
├── components/ (excluded from systematic changes)
└── design-tokens/
- Home page: Fixed "Start by using the design system" spacing
- CardLite component: Consistent card heading patterns
- All Get Started pages: Subtitle/title/introduction spacing
- Foundation pages: Introduction text consistency + added subtitles
- Design token pages: Replaced h1 tags with GoabText for consistent spacing
- AccessibilityEmpty component: Adjusted margins for tighter text spacing
- Start development server:
npm run dev - Read files first before making changes to understand structure
- Test spacing visually - the defaults should look good, override only for content relationships
- Check semantic HTML in browser dev tools to verify heading hierarchy
- Test responsive behavior when possible
- Convert
<h1>tags: Replace with<GoabText tag="h1" size="heading-xl"> - Remove excessive explicit margins: Trust defaults, add
mt="none"for content relationships - Add semantic tags: Ensure proper
tag="h1",tag="h2"hierarchy - Foundation page categorization: Add "Content guidelines" or "Style guide" subtitles
Look for these outdated patterns:
// ❌ OLD: Explicit margins that now create double spacing
<GoabText size="heading-xl" mt="xl" mb="m">Title</GoabText>
// ✅ NEW: Trust defaults, override relationships
<GoabText tag="h1" size="heading-xl">Title</GoabText>
<GoabText size="body-l" mt="none">Connected content</GoabText>- Components section: Interactive sandboxes and version switching
- Examples section: 4-version support and GitHub integration
- Spacing System Evolution: The progression from explicit margins → no defaults → intelligent defaults taught us the importance of design system consistency
- Manual Review Essential: Automated changes can miss important context about content relationships
- Component Interconnections: Changes to shared components (CardLite, AccessibilityEmpty) affect multiple pages
- Version Complexity: The 4-version system (LTS/Latest × React/Angular) adds significant complexity to examples and components
- GitHub Integration: Dynamic content sourcing means some information should never be manually edited
- v4 → v6: Component prefix changes (
GoA→Goab), margin type system updates - Spacing System Updates: Multiple iterations to find the right balance between automatic spacing and manual control
- Version System Implementation: Addition of LTS/Latest support with framework switching
- GitHub Integration: Move to dynamic metadata sourcing for examples and components
- Test across all page types before rolling out systematic changes
- Understand content relationships before adjusting spacing
- Preserve semantic HTML structure for accessibility
- Document architectural decisions to prevent future confusion
npm run dev # Start development server
npm run build # Build for production
npm run lint # Run ESLint
npm run prettier # Format code- Foundations section (static content)
- Get Started section (static content)
- Design Tokens section (static content)
- Home page content
- Examples section (dynamic templates, GitHub integration)
- Components section (interactive sandboxes, property tables)
For comprehensive guidance on making changes, see AI_INSTRUCTIONS.md