WORK-064
ID:WORK-064Status:done

Section Anatomy Dimension

Priority:highComplexity:moderateMilestone:v0.9.0Source:SPEC-025

Criteria completion

Criteria completion: 6 of 6 (100%) checked; history from Mar 24 to Mar 240%25%50%75%100%Mar 24Mar 24
Branches 2
History 5
  1. e900a90
    Created (done)by bjornolofandersson
  2. f262d7b
    Content editedby Claude
  3. b602a0e
    • ☑ `RuneConfig` in `packages/transform/src/types.ts` gains `sections?: Record<string, 'header' | 'title' | 'description' | 'body' | 'footer' | 'media'>`
    • ☑ Identity transform emits `data-section` on elements whose ref maps to a section role
    • ☑ Existing BEM classes and `data-name` attributes are preserved (additive only)
    • ☑ All container-level rune configs annotated with `sections` per SPEC-025 Table 1
    • ☑ `refrakt inspect` output shows `data-section` attributes on structural elements
    • ☑ Unit tests verify section attribute emission for a sample of runes
    by Claude
  4. a129a9e
    Content editedby Claude
  5. a333007
    Created (ready)by Claude
    Add work items for SPEC-024 (Metadata) and SPEC-025 (Universal Theming)

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

  • RuneConfig in packages/transform/src/types.ts gains sections?: Record<string, 'header' | 'title' | 'description' | 'body' | 'footer' | 'media'>
  • Identity transform emits data-section on elements whose ref maps to a section role
  • Existing BEM classes and data-name attributes are preserved (additive only)
  • All container-level rune configs annotated with sections per SPEC-025 Table 1
  • refrakt inspect output shows data-section attributes on structural elements
  • Unit tests verify section attribute emission for a sample of runes

Approach

  1. Add sections to RuneConfig interface
  2. In the engine's applyBemClasses or structure injection code, when a ref matches a key in the sections map, emit data-section with the mapped role value
  3. Work through SPEC-025 Table 1 to annotate all rune configs

References

  • SPEC-025 (Universal Theming Dimensions — Section Anatomy, Table 1: Section Anatomy Map)