WORK-722
ID:WORK-722Status:ready

Every fact a class carries is also an attribute, and the CSS reads the attribute

SPEC-196 D5. Before classes become optional, each fact only a class carries today gets a data attribute, and the engine emits both. The measurement in D5 found two such facts:

Priority:highComplexity:moderateMilestone:v0.50.0Source:SPEC-196
claude/composition-usage-rune-pages-c87ar6 View source

Criteria completion

Criteria completion: 0 of 9 (0%) checked; tracking started on Nov 9, no incremental history yet0%25%50%75%100%Nov 9Nov 22

Tracking started Nov 9 — check back for trends.

Branches 3
History 1
  1. aea7072
    Created (ready)by bjornolofandersson

Acceptance Criteria

  • The context-modifier facet sets data-in="<parent rune>" on every element it gives a context-modifier class, and keeps the class
  • The tint facet sets data-tinted="" wherever it adds --tinted, and keeps the class
  • The 31 context-modifier selectors in Lumina and the skeleton select [data-in="…"] instead of the class
  • The 14 static-modifier selectors select the attributes that already say the same fact
  • staticModifiers is marked deprecated in packages/transform/src/types.ts, pointing at SPEC-196 D5
  • Engine tests cover data-in (including a rune nested in a parent it does not declare, which gets none) and data-tinted (set, and absent for tint="custom" with no tokens)
  • Both contract copies (contracts/structures.json, packages/lumina/contracts/structures.json) are regenerated and record the new attributes
  • The CSS coverage test passes, with its expectations updated for selectors that moved to attributes
  • npm run seo:baseline:check passes, or the baseline is regenerated and its diff shows only the new attributes

Approach

  • The facets are packages/transform/src/facets/modifiers.ts (context and static modifiers) and facets/tint.ts. Emit the attribute in the same place the class is added, so the two cannot diverge.
  • data-in holds the parent's data-rune name, the same key contextModifiers already uses. The value is the declared parent, not every ancestor: it says what the class said and no more.
  • The names were checked free in D5: data-in and data-tinted appear nowhere in packages or plugins (data-parent is taken by realm).
  • Use refrakt inspect on actions inside bar and on showcase inside bento-cell to see both outputs before moving their CSS. Those two hold 17 of the 31 selectors.
  • A selector change keeps its specificity in mind: .rf-actions--in-bar and .rf-actions[data-in="bar"] differ, so check the rules that relied on the old weight.

References

  • SPEC-196 D5, and "What exists, measured".
  • SPEC-194 D5: the config fields kept and deprecated.
  • ADR-048: implementation order, step 1.