docs(spec): define authoring-time palette generation - #5986
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
cixzhang
left a comment
There was a problem hiding this comment.
Palette authors could otherwise receive a production recipe whose behavior is defined by mutable Sandbox code, while standalone consumers still cannot require accessible foreground/background relationships.
Before this contract is ready:
- Replace the Sandbox source reference with explicit normative recipe requirements in this specification. Enumerate the profiles, anchor behavior, light/dark treatment, gamut mapping, precision, rounding, serialization, and failure behavior that production must preserve. Add version-pinned conformance fixtures that lock canonical requests, exact outputs or digests, and pass/fail thresholds for hue drift, adjacent-stop distinction, family distinction, and color-vision simulations. The Sandbox can demonstrate the behavior, but it must not own it.
- Add pairwise contrast constraints for standalone palette use: exact foreground/background stop references, mode, minimum ratio, and opacity/compositing assumptions. A hard constraint that cannot be satisfied should fail the whole request without a candidate; the receipt should report the exact pair and measured result. Keep contextual component states and non-color cues outside the palette-level guarantee.
- Define valid custom stop layouts separately from accepted-palette validity: minimum cardinality, finite values, bounds, uniqueness, ordering, endpoint requirements, and decimal representation. “Any non-empty numeric list” currently admits inputs the referenced generator rejects.
The separate-export boundary is otherwise aligned: generated palettes remain outside defineTheme, and authors explicitly select and save theme values.
[Reviewed by Robohands]
|
I addressed the actionable parts of this review in d4c6bd0:
I am intentionally not adding palette-level foreground/background contrast guarantees. The palette is a set of authoring candidates and does not know the component context, text size, state, opacity, or composited background. Contextual contrast measurement is separate follow-up work; this generator does not claim accessibility for isolated colors. |
|
The implementation described here is now open as #5992. It includes the pure authoring API, TypeScript/JSON CLI output, overwrite protection, receipts, canonical digest fixtures, and Sandbox parity coverage. |
|
Thanks for the detailed review, Cindy. I updated the contract to address the actionable items:
I kept pairwise contrast out of this foundational generator contract because a palette alone does not know which colors will be used together, at what opacity, or in which component state. We are not making an accessibility claim here; contextual contrast analysis will be a separate follow-up once that usage information is available. I also aligned the anchor terminology on |
|
/approve-spec |
cixzhang
left a comment
There was a problem hiding this comment.
The recipe is now specified independently from the Sandbox, custom stop semantics are explicit, and the separate authoring-time palette boundary is clear. Approved at this exact head.
Summary
Follow-up boundaries
Related work
Verification
No Changeset: specification only.