WORK-369
ID:WORK-369Status:done

bg gradient fill: inline facets + structured BgPresetDefinition.gradient

Add a token-driven bg gradient fill via inline facets and a structured BgPresetDefinition.gradient preset field.

Priority:mediumComplexity:moderateMilestone:v0.20.0Source:SPEC-088

Criteria completion

Criteria completion: 3 of 3 (100%) checked; history from Jun 9 to Jun 90%25%50%75%100%Jun 9Jun 9
Branches 2
History 4
  1. 1731c3d
    • ☑ Inline facets `bg-gradient` (bounded direction set), `bg-from|to|via` (semantic token refs → `var(--rf-color-*)`), `bg-gradient-type` (`linear|radial|conic`); colours stay token-owned.
    • ☑ Named gradient presets live on `BgPresetDefinition.gradient` (type + direction + token-name stops), not the raw `style` map; `bg="name"` applies; `extends` works.
    • ☑ A fill gradient occupies the base bg layer (reuses `--bg-image`), composing beneath scrim/substrate and with the tint/inset fill.
    by bjornolofandersson
  2. 3952770
    Content editedby Claude
    plan: mark Batch 4 (SPEC-088 bg gradients & scrim) done + changeset
  3. 9c0545a
    Created (ready)by bjornolofandersson
  4. 1da59d6
    Content editedby Claude
    plan: add v0.20.0 milestone and break down SPEC-086..091 into work items

Acceptance Criteria

  • Inline facets bg-gradient (bounded direction set), bg-from|to|via (semantic token refs → var(--rf-color-*)), bg-gradient-type (linear|radial|conic); colours stay token-owned.
  • Named gradient presets live on BgPresetDefinition.gradient (type + direction + token-name stops), not the raw style map; bg="name" applies; extends works.
  • A fill gradient occupies the base bg layer (reuses --bg-image), composing beneath scrim/substrate and with the tint/inset fill.

Approach

BgPresetDefinition in types.ts; bg.css --bg-image. SPEC-088 §1.

References

  • SPEC-088

Resolution

Completed: 2026-06-09

Branch: claude/spec-088-bg-gradients-scrim

What was done

  • BgPresetDefinition.gradient { type?, direction?, stops } (stops are token names → var(--rf-color-*)).
  • Universal facets bg-gradient/bg-from/bg-to/bg-via/bg-gradient-type (+ on the {% bg %} directive), injected as metas; engine buildBgGradient resolves a bounded direction set + token stops into --bg-image. Inline facets override a preset's facets; stops fall back to the preset. A gradient-only bg raises the layer with no image; extends works.

Notes

  • Tests in packages/transform/test/bg-gradient.test.ts.