Triggers
- ux architecture
- css architecture
- design system css
- layout framework
- responsive framework
- css variables
- design tokens css
- theme toggle
- dark mode toggle
- information architecture
- developer handoff
- css foundation
- grid layout
- flexbox layout
- breakpoint strategy
- mobile first
- component architecture
- technical foundation
Instructions
CSS Design System Foundation
Create developer-ready CSS foundations with:
- CSS Custom Properties: Light/dark theme color tokens, typography scale, spacing system, container widths
- Theme System: Light theme defaults,
[data-theme="dark"] overrides, prefers-color-scheme media query fallback
- Typography Scale: Semantic heading classes (.text-heading-1 through .text-heading-6) with font-size, font-weight, line-height, margin
- Spacing System: 4px-based scale (space-1 through space-16) for consistent vertical rhythm
- Container System: Full-width mobile with responsive max-widths (640px, 768px, 1024px, 1280px)
Layout Framework
Design layout patterns using modern CSS:
- Grid Patterns: 2-column, 3-column, 4-column with responsive single-column fallback
- Flexbox Utilities: Alignment, distribution, wrapping helpers
- Hero Section: Full viewport height, centered content pattern
- Sidebar Layout: 2fr main + 1fr sidebar with gap
- Card Layout: CSS Grid auto-fit with minimum card widths
Theme Toggle System
Always include a light/dark/system theme toggle:
- HTML component with
role="radiogroup" and aria-label
- JavaScript ThemeManager class handling localStorage persistence and system preference detection
- CSS for toggle appearance with active state indication
Information Architecture
- Page Hierarchy: 5-7 main navigation sections maximum
- Visual Weight System: H1 > H2 > H3 > Body > CTAs with decreasing visual prominence
- Content Flow: Logical progression through sections
- CTA Placement: Above fold, section ends, footer
Interaction Patterns
- Smooth scroll to sections with active state indicators
- Theme switching with instant visual feedback
- Forms with clear labels, validation feedback, progress indicators
- Buttons with hover, focus, and loading states
- Cards with subtle hover effects and clear clickable areas
Developer Handoff
- Generate CSS foundation files with documented patterns
- Specify component requirements and dependencies
- Include responsive behavior specifications
- Establish implementation priority order:
- Design system variables
- Layout structure
- Component base
- Content integration
- Interactive polish
EloPhanto Tool Integration
- Use
browser_navigate to review existing site implementations
- Use
knowledge_write to persist architecture decisions and CSS systems
- Use
web_search to research CSS patterns and browser compatibility
Deliverables
CSS Design System
:root {
--bg-primary: [spec-light-bg];
--bg-secondary: [spec-light-secondary];
--text-primary: [spec-light-text];
--text-secondary: [spec-light-text-muted];
--border-color: [spec-light-border];
--primary-color: [spec-primary];
--secondary-color: [spec-secondary];
--accent-color: [spec-accent];
--text-xs: 0.75rem;
--text-sm: 0.875rem;
--text-base: 1rem;
--text-lg: 1.125rem;
--text-xl: 1.25rem;
--text-2xl: 1.5rem;
--text-3xl: 1.875rem;
--space-1: 0.25rem;
--space-2: 0.5rem;
--space-4: 1rem;
--space-6: 1.5rem;
--space-8: 2rem;
--space-12: 3rem;
--space-16: 4rem;
--container-sm: 640px;
--container-md: 768px;
--container-lg: 1024px;
--container-xl: 1280px;
}
[data-theme="dark"] {
--bg-primary: [spec-dark-bg];
--text-primary: [spec-dark-text];
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) {
--bg-primary: [spec-dark-bg];
--text-primary: [spec-dark-text];
}
}
Theme Toggle HTML
<div class="theme-toggle" role="radiogroup" aria-label="Theme selection">
<button class="theme-toggle-option" data-theme="light" role="radio" aria-checked="false">Light</button>
<button class="theme-toggle-option" data-theme="dark" role="radio" aria-checked="false">Dark</button>
<button class="theme-toggle-option" data-theme="system" role="radio" aria-checked="true">System</button>
</div>
ThemeManager JavaScript
class ThemeManager {
constructor() {
this.currentTheme = this.getStoredTheme() || this.getSystemTheme();
this.applyTheme(this.currentTheme);
this.initializeToggle();
}
getSystemTheme() {
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
}
getStoredTheme() { return localStorage.getItem('theme'); }
applyTheme(theme) {
if (theme === 'system') {
document.documentElement.removeAttribute('data-theme');
localStorage.removeItem('theme');
} else {
document.documentElement.setAttribute('data-theme', theme);
localStorage.setItem('theme', theme);
}
this.currentTheme = theme;
this.updateToggleUI();
}
initializeToggle() {
const toggle = document.querySelector('.theme-toggle');
if (toggle) {
toggle.addEventListener('click', (e) => {
if (e.target.matches('.theme-toggle-option')) {
this.applyTheme(e.target.dataset.theme);
}
});
}
}
updateToggleUI() {
document.querySelectorAll('.theme-toggle-option').forEach(option => {
option.classList.toggle('active', option.dataset.theme === this.currentTheme);
});
}
}
document.addEventListener('DOMContentLoaded', () => new ThemeManager());
Architecture Deliverable Template
# [Project Name] Technical Architecture & UX Foundation
## CSS Architecture
- **Design System Variables**: Color, typography, spacing tokens
- **Layout Framework**: Container, grid, flexbox patterns
- **Theme System**: Light/dark/system with toggle component
## UX Structure
- **Information Architecture**: Page hierarchy, navigation, content flow
- **Responsive Strategy**: Mobile-first with breakpoints at 640/768/1024/1280px
- **Accessibility Foundation**: Keyboard nav, screen readers, WCAG AA contrast
## Developer Implementation Guide
1. Foundation Setup: Design system variables
2. Layout Structure: Responsive containers and grids
3. Component Base: Reusable component templates
4. Content Integration: Proper hierarchy
5. Interactive Polish: Hover states and animations
## File Structure
css/design-system.css, css/layout.css, css/components.css, css/utilities.css
js/theme-manager.js, js/main.js
Success Metrics
- Developers can implement designs without architectural decisions
- CSS remains maintainable and conflict-free throughout development
- UX patterns guide users naturally through content and conversions
- Projects have consistent, professional appearance baseline
- Technical foundation supports both current needs and future growth
Verify
- The change was rendered in a browser/simulator and a screenshot or DOM snapshot was captured, not just code-reviewed
- Layout was checked at the breakpoints the ux-architecture guide calls out (mobile + desktop minimum); evidence of each is attached
- Color, typography, and spacing values used come from the project's design tokens / theme, not hard-coded ad-hoc values
- Keyboard navigation and focus order were exercised on every interactive element introduced
- Reduced-motion / dark-mode (when supported) variants were verified, not assumed to inherit
- No console errors or hydration warnings were emitted during the verification render
1---2name: ux-architecture3description: Technical architecture and UX specialist providing developers with CSS systems, layout frameworks, and clear implementation guidance. Adapted from msitarzewski/agency-agents.4---56## Triggers78- ux architecture9- css architecture10- design system css11- layout framework12- responsive framework13- css variables14- design tokens css15- theme toggle16- dark mode toggle17- information architecture18- developer handoff19- css foundation20- grid layout21- flexbox layout22- breakpoint strategy23- mobile first24- component architecture25- technical foundation2627## Instructions2829### CSS Design System Foundation30Create developer-ready CSS foundations with:31321. **CSS Custom Properties**: Light/dark theme color tokens, typography scale, spacing system, container widths332. **Theme System**: Light theme defaults, `[data-theme="dark"]` overrides, `prefers-color-scheme` media query fallback343. **Typography Scale**: Semantic heading classes (.text-heading-1 through .text-heading-6) with font-size, font-weight, line-height, margin354. **Spacing System**: 4px-based scale (space-1 through space-16) for consistent vertical rhythm365. **Container System**: Full-width mobile with responsive max-widths (640px, 768px, 1024px, 1280px)3738### Layout Framework39Design layout patterns using modern CSS:40- **Grid Patterns**: 2-column, 3-column, 4-column with responsive single-column fallback41- **Flexbox Utilities**: Alignment, distribution, wrapping helpers42- **Hero Section**: Full viewport height, centered content pattern43- **Sidebar Layout**: 2fr main + 1fr sidebar with gap44- **Card Layout**: CSS Grid auto-fit with minimum card widths4546### Theme Toggle System47Always include a light/dark/system theme toggle:48- HTML component with `role="radiogroup"` and `aria-label`49- JavaScript ThemeManager class handling localStorage persistence and system preference detection50- CSS for toggle appearance with active state indication5152### Information Architecture53- **Page Hierarchy**: 5-7 main navigation sections maximum54- **Visual Weight System**: H1 > H2 > H3 > Body > CTAs with decreasing visual prominence55- **Content Flow**: Logical progression through sections56- **CTA Placement**: Above fold, section ends, footer5758### Interaction Patterns59- Smooth scroll to sections with active state indicators60- Theme switching with instant visual feedback61- Forms with clear labels, validation feedback, progress indicators62- Buttons with hover, focus, and loading states63- Cards with subtle hover effects and clear clickable areas6465### Developer Handoff66- Generate CSS foundation files with documented patterns67- Specify component requirements and dependencies68- Include responsive behavior specifications69- Establish implementation priority order:70 1. Design system variables71 2. Layout structure72 3. Component base73 4. Content integration74 5. Interactive polish7576### EloPhanto Tool Integration77- Use `browser_navigate` to review existing site implementations78- Use `knowledge_write` to persist architecture decisions and CSS systems79- Use `web_search` to research CSS patterns and browser compatibility8081## Deliverables8283### CSS Design System84```css85:root {86 --bg-primary: [spec-light-bg];87 --bg-secondary: [spec-light-secondary];88 --text-primary: [spec-light-text];89 --text-secondary: [spec-light-text-muted];90 --border-color: [spec-light-border];91 --primary-color: [spec-primary];92 --secondary-color: [spec-secondary];93 --accent-color: [spec-accent];9495 --text-xs: 0.75rem;96 --text-sm: 0.875rem;97 --text-base: 1rem;98 --text-lg: 1.125rem;99 --text-xl: 1.25rem;100 --text-2xl: 1.5rem;101 --text-3xl: 1.875rem;102103 --space-1: 0.25rem;104 --space-2: 0.5rem;105 --space-4: 1rem;106 --space-6: 1.5rem;107 --space-8: 2rem;108 --space-12: 3rem;109 --space-16: 4rem;110111 --container-sm: 640px;112 --container-md: 768px;113 --container-lg: 1024px;114 --container-xl: 1280px;115}116117[data-theme="dark"] {118 --bg-primary: [spec-dark-bg];119 --text-primary: [spec-dark-text];120}121122@media (prefers-color-scheme: dark) {123 :root:not([data-theme="light"]) {124 --bg-primary: [spec-dark-bg];125 --text-primary: [spec-dark-text];126 }127}128```129130### Theme Toggle HTML131```html132<div class="theme-toggle" role="radiogroup" aria-label="Theme selection">133 <button class="theme-toggle-option" data-theme="light" role="radio" aria-checked="false">Light</button>134 <button class="theme-toggle-option" data-theme="dark" role="radio" aria-checked="false">Dark</button>135 <button class="theme-toggle-option" data-theme="system" role="radio" aria-checked="true">System</button>136</div>137```138139### ThemeManager JavaScript140```javascript141class ThemeManager {142 constructor() {143 this.currentTheme = this.getStoredTheme() || this.getSystemTheme();144 this.applyTheme(this.currentTheme);145 this.initializeToggle();146 }147148 getSystemTheme() {149 return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';150 }151152 getStoredTheme() { return localStorage.getItem('theme'); }153154 applyTheme(theme) {155 if (theme === 'system') {156 document.documentElement.removeAttribute('data-theme');157 localStorage.removeItem('theme');158 } else {159 document.documentElement.setAttribute('data-theme', theme);160 localStorage.setItem('theme', theme);161 }162 this.currentTheme = theme;163 this.updateToggleUI();164 }165166 initializeToggle() {167 const toggle = document.querySelector('.theme-toggle');168 if (toggle) {169 toggle.addEventListener('click', (e) => {170 if (e.target.matches('.theme-toggle-option')) {171 this.applyTheme(e.target.dataset.theme);172 }173 });174 }175 }176177 updateToggleUI() {178 document.querySelectorAll('.theme-toggle-option').forEach(option => {179 option.classList.toggle('active', option.dataset.theme === this.currentTheme);180 });181 }182}183184document.addEventListener('DOMContentLoaded', () => new ThemeManager());185```186187### Architecture Deliverable Template188```markdown189# [Project Name] Technical Architecture & UX Foundation190191## CSS Architecture192- **Design System Variables**: Color, typography, spacing tokens193- **Layout Framework**: Container, grid, flexbox patterns194- **Theme System**: Light/dark/system with toggle component195196## UX Structure197- **Information Architecture**: Page hierarchy, navigation, content flow198- **Responsive Strategy**: Mobile-first with breakpoints at 640/768/1024/1280px199- **Accessibility Foundation**: Keyboard nav, screen readers, WCAG AA contrast200201## Developer Implementation Guide2021. Foundation Setup: Design system variables2032. Layout Structure: Responsive containers and grids2043. Component Base: Reusable component templates2054. Content Integration: Proper hierarchy2065. Interactive Polish: Hover states and animations207208## File Structure209css/design-system.css, css/layout.css, css/components.css, css/utilities.css210js/theme-manager.js, js/main.js211```212213## Success Metrics214215- Developers can implement designs without architectural decisions216- CSS remains maintainable and conflict-free throughout development217- UX patterns guide users naturally through content and conversions218- Projects have consistent, professional appearance baseline219- Technical foundation supports both current needs and future growth220221## Verify222223- The change was rendered in a browser/simulator and a screenshot or DOM snapshot was captured, not just code-reviewed224- Layout was checked at the breakpoints the ux-architecture guide calls out (mobile + desktop minimum); evidence of each is attached225- Color, typography, and spacing values used come from the project's design tokens / theme, not hard-coded ad-hoc values226- Keyboard navigation and focus order were exercised on every interactive element introduced227- Reduced-motion / dark-mode (when supported) variants were verified, not assumed to inherit228- No console errors or hydration warnings were emitted during the verification render