How digdir/designsystemet works
Main Architecture Components
a) Core Packages Layer:
• React Components (@digdir/designsystemet-react)
• CSS Styles (@digdir/designsystemet-css)
• Theming System (@digdir/designsystemet-theme)
• CLI Tools (@digdir/designsystemet)
b) Applications Layer:
• Storybook (Component Documentation)
• Storefront (General Documentation)
• Theme Builder
• Development App
c) Design Tokens Layer:
• Base Tokens
• Brand-specific Tokens
• Viewport-specific Tokens
Relationships and Flow
a) Design Token Flow:
Design Tokens → CLI Build Process → CSS Theme Files → Components
b) Component Implementation Flow:
React Components ←→ CSS Styles ←→ Theme System
c) Documentation Flow:
Components → Storybook
Documentation → Storefront
Theme System → Theme Builder
Detailed Component Structure
• Component hierarchy
• Shared utilities and hooks
• Form components
• Typography system
• Layout components
Implementation Details
Technical annotations for:
• CSS implementation approach
• Theme customization flow
• Component composition patterns
• Build and deployment processes
Integration Points
Highlight:
• Figma integration via Token Studio
• Custom theme creation workflow
• Font system integration
• TypeScript type generation
The build and deployment pipeline
This system design should reflect both the technical architecture and the user-facing aspects of the design system, making it valuable for both developers and designers.