ID:WORK-064Status:donePriority:highComplexity:moderateMilestone:v0.9.0
Section Anatomy Dimension
Summary
Add a section anatomy mapping to rune configs and the identity transform. Runes declare a sections map that associates each structural ref with a standard section role (header, title, description, body, footer, media). The transform emits data-section attributes alongside existing BEM classes, enabling themes to style structural anatomy generically across all runes.
Acceptance Criteria
RuneConfiginpackages/transform/src/types.tsgainssections?: Record<string, 'header' | 'title' | 'description' | 'body' | 'footer' | 'media'>- Identity transform emits
data-sectionon elements whose ref maps to a section role - Existing BEM classes and
data-nameattributes are preserved (additive only) - All container-level rune configs annotated with
sectionsper SPEC-025 Table 1 refrakt inspectoutput showsdata-sectionattributes on structural elements- Unit tests verify section attribute emission for a sample of runes
Approach
- Add
sectionstoRuneConfiginterface - In the engine's
applyBemClassesor structure injection code, when a ref matches a key in thesectionsmap, emitdata-sectionwith the mapped role value - Work through SPEC-025 Table 1 to annotate all rune configs
References
- SPEC-025 (Universal Theming Dimensions — Section Anatomy, Table 1: Section Anatomy Map)