| description | Central UI strategy and component development philosophy |
|---|
This file defines the central UI development strategy for Tailspin Toys. Technology-specific guidance is in separate instruction files.
- Astro (
.astrofiles): Page routing, layouts, static content - Svelte (
.sveltefiles): Interactive components, client-side state - Tailwind CSS (
.cssfiles): Styling via utility classes
Refer to technology-specific instruction files:
svelte.instructions.md- Svelte 5 components with runesastro.instructions.md- Astro pages and layoutstailwindcss.instructions.md- Tailwind CSS styling patterns
- Every interactive element MUST include a
data-testidattribute - Use descriptive test IDs that identify the element's purpose and context
- Examples:
data-testid="game-card-{game.id}",data-testid="submit-button",data-testid="nav-home"
- Use semantic HTML elements (
<nav>,<main>,<article>,<button>) - Provide ARIA labels and roles where semantic HTML isn't sufficient
- Ensure keyboard navigation works for all interactive elements
- Include visible focus states:
focus:ring-2 focus:ring-blue-500 focus:outline-none - Maintain sufficient color contrast (especially in dark theme)
- Dark theme throughout the application
- Modern, clean UI with rounded corners and smooth transitions
- Consistent spacing and visual hierarchy
- Responsive design that works on mobile, tablet, and desktop
- Create reusable components for common UI patterns
- Keep components focused on a single responsibility
- Use props for configuration, not duplication
- Document component APIs with TypeScript types
-
Choose the right technology:
- Static content → Astro
- Interactivity → Svelte
- Styling → Tailwind
-
Follow technology-specific patterns:
- Refer to the appropriate instruction file
-
Ensure testability:
- Add
data-testidto all interactive elements
- Add
-
Verify accessibility:
- Test keyboard navigation
- Check focus states
- Validate semantic structure