Reference for analyzing code and creating specifications with OBJECT IDs for Figma export.
Extract component information from code to create specifications:
Component Structure:
Props & States:
Visual Properties:
Content:
Behavior:
Create OBJECT IDs following project naming conventions. Determine the pattern by analyzing existing IDs in specifications:
Pattern A - Page-based:
{page}-{section}-{element}start-hero-cta, start-message-headlinePattern B - Component-based:
{component}-{variant}-{state}btn-cta-primary-hover, input-text-disabledPattern C - Hierarchical:
{parent}-{child}-{grandchild}header-nav-menu-item, footer-social-icon-twitterFor each component without OBJECT ID:
Generate a specification document with the generated OBJECT IDs.
Determine location:
docs/D-Design-System/03-Atomic-Components/{category}/docs/C-UX-Scenarios/{scenario}/{page}/docs/D-Design-System/04-Molecules/ or 05-Organisms/Specification structure:
# {Component/Page Name}
**OBJECT ID**: `{primary-object-id}`
## Purpose
{Brief description from code analysis}
## Structure
- **HTML Tag**: `<{tag}>`
- **CSS Class**: `.{class-name}`
- **Component File**: `{file-path}`
- **OBJECT ID**: `{object-id}`
## Visual Style
- **Typography**: {font-family}, {size}, {weight}, {color}
- **Colors**: Background, Border, Text
- **Spacing**: Padding, Margin
- **Layout**: {display}, {positioning}
## States
### {State Name}
- **OBJECT ID**: `{component-id-state}`
- **Visual Changes**: {description}
- **Trigger**: {user action or condition}
## Behavior
{Interactive behavior description}
## Content
- **EN**: "{english-content}"
- **SE**: "{swedish-content}" (if applicable)
Present the generated specification for approval:
Present:
User options:
Once approved, proceed to HTML generation with finalized OBJECT IDs.