Skip to content

docs(theme): define approved palette authoring contract - #5985

Merged
rubyycheung merged 4 commits into
mainfrom
codex/palette-contract-spec
Sep 4, 2026
Merged

docs(theme): define approved palette authoring contract#5985
rubyycheung merged 4 commits into
mainfrom
codex/palette-contract-spec

Conversation

@rubyycheung

@rubyycheung rubyycheung commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Defines AST-018 as the authoring contract for optional, private, theme-owned palettes.
  • Keeps palette data outside defineTheme(), Core runtime APIs, generated CSS, and generic theme builds.
  • Allows a theme to use literal CSS values or explicitly reference exact values from its committed palette file.
  • Requires missing references to fail and palette changes to be reviewed as theme changes.
  • Allows any non-empty author-defined numeric stop layout.
  • Allows accepted palettes to include or omit black and white endpoints; exact black and white remain available as ordinary theme values.
  • Separates structural validation, Neutral adoption, palette generation, and future diagnostics into follow-up work.

Why

This replaces the mixed scope in #5668 with a specification-only foundation. It establishes ownership and lifecycle boundaries without adding palette behavior to defineTheme() or runtime theming.

Verification

  • Knowledge templates and records are aligned.
  • Full pre-commit repository checks
  • git diff --check

No Changeset: specification only.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 3, 2026
@vercel

vercel Bot commented Sep 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Sep 4, 2026 3:40pm UTC

Request Review

@rubyycheung

Copy link
Copy Markdown
Contributor Author

Split follow-ups are now open:

The next implementation order is production generator first, then the palette-reading and diagnostic CLI features proposed by Joey.

@cixzhang cixzhang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Theme authors get a reviewable palette reference without coupling runtime themes to palette data. Neutral adoption and generation stay independently reviewable.

[Reviewed by Robohands]

@rubyycheung

Copy link
Copy Markdown
Contributor Author

Follow-up implementation is now open as #5992. It keeps defineTheme unchanged and generates standalone, reviewable palette files.

@cixzhang cixzhang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Theme-package validators could accept different palette shapes because “ordered numeric stop labels” does not define what makes a label valid.

Please align accepted palette structure with AST-008’s generated output boundary: stop labels are finite JSON numbers from 0 through 100, unique and strictly increasing; integer and decimal stops are valid; equivalent spellings such as 5 and 5.0 are the same stop; endpoints are optional; and a one-stop ramp is valid. Keep this independent from the generator’s default 21-stop layout.

Direct references from a committed palette remain allowed under FR5: changing a referenced value is an intentional theme change that requires rendered review.

[Reviewed by Robohands]

@rubyycheung

Copy link
Copy Markdown
Contributor Author

Addressed in 0930d3b: AST-018 now defines palette stop labels as finite JSON numbers in 0..100, unique after numeric normalization, strictly increasing, with optional endpoints and valid one-stop ramps. The 21-stop layout remains a generator/theme choice, and FR5 direct references remain allowed.

@cixzhang cixzhang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this resolves our stop-label request: palette validation and generation now share one numeric shape without making the 21-stop generator default universal.

[Reviewed by Robohands]

@rubyycheung
rubyycheung merged commit 885af34 into main Sep 4, 2026
28 checks passed
@github-actions
github-actions Bot deleted the codex/palette-contract-spec branch September 5, 2026 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. spec-auto-merge Auto-merge was enabled by the spec owner gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants