Skip to content
This repository was archived by the owner on Nov 2, 2026. It is now read-only.

RR-96: theme variants; the dark theme becomes a variant of every theme (4.0.0) - #10

Merged
michaeljgrimm merged 2 commits into
mainfrom
codex/rr-96-theme-variants
Oct 19, 2026
Merged

michaeljgrimm merged 2 commits into
mainfrom
codex/rr-96-theme-variants

Conversation

@michaeljgrimm

@michaeljgrimm michaeljgrimm commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

What

RR-96 step 4 (gallery half; design). Core #732 adds design.variant: a map over a deck's one 12-slot color scheme (PowerPoint's color map), as "light1" | "light2" | "dark1" | "dark2" or { background, accents } with an accent order. Theme records now offer variants:

  • minimal, classic and bold gain variants: [{ id, name, variant }] with light, light-alt, dark and dark-alt. variant is the value of design.variant; a host applies a variant by writing it there. The variant whose background is the theme's own background is the theme's look (Minimal's own is dark2, so its dark is dark2). The alt variants reorder the accents of the same scheme (cool-horizon: teal-led for Minimal and Classic; burnt-orange: navy-led on light, amber-led on dark for Bold). Never a second scheme.
  • The dark theme is removed. Dark is now a variant of every theme. Its boost colors with seaford fonts pairing is not kept as a theme: a document wanting it writes colorScheme: "boost", fontScheme: "seaford" and a dark variant (the boost and seaford records stay).
  • README ("Theme variants"), CHANGELOG and CONTRIBUTING updated; test/records.test.mjs checks every theme's variants (unique kebab ids, names, a light and a dark one, a valid background slot, accents a permutation of accent1 to accent6, one variant equal to the theme's own background).

Version: 4.0.0 (major)

The rule in CONTRIBUTING: a removed or renamed id is a major release, check:stability fails a minor/patch release that removes an id. Adding variants alone would be a minor release (new data on existing records, no drawing changes); removing the dark theme is what makes it major, as asked. CATALOG_SCHEMA stays 3. check:stability against 3.0.0: layouts 28/0 changed, themes 3 drawn/0 changed/1 removed, colour schemes 14/0, font schemes 89/0, "OK: ... or the release is major". package.json and package-lock.json carry 4.0.0; releasing follows CONTRIBUTING (release PR moves the changelog section, tag v4.0.0).

Engines

A 4.0.0 package can no longer be tested by the 0.19 pins, and the one-release 3.0.0 bootstrap only runs for 3.0.0, so development and CI use the published @openpresentation/opf and opf-render 0.23.0 (core, renderer and PPTX 0.23.0 are on npm with verified provenance). Core 0.23.0 derives borders, gridlines, axis lines, chart text and code colors from the color scheme, so seven layout previews are redrawn with npm run previews (not hand-edited; a redraw is allowed because this is the major): chart, chart-beside, code, dashboard, table, table-beside and timeline. previews/layouts/index.json records their new sizes. The other 21 previews are unchanged; check:previews passes.

For core (not blocking this PR)

Core 0.23.0 has no variants property on the theme record schema (opf-theme/v1, spec/schemas/theme.schema.json); the schema has no additionalProperties: false at the root, so the records validate today, but variants and its variant value are not documented or checked by core. This PR checks each variant value with core's normalizeColorVariant in test/records.test.mjs; core should add variants to the theme schema (variant as its ColorVariant/background-slot union) so the gallery can validate whole theme records against it in a later core release.

Verification

On Node 24 (CI's version), npm ci with the 0.23.0 pins, then check:license, verify, npm test (114 pass), typecheck, check:previews, check:stability ("OK: every existing record draws the same, or the release is major") and pack:dry-run all pass locally. test/records.test.mjs now validates every theme's variants[].variant with core 0.23.0's own normalizeColorVariant and isColorVariant (exported from @openpresentation/opf/composition) instead of a hand-written shape check. Core 0.23.0's theme record schema still has no variants property (see below), so the records are not yet schema-validated beyond that.

🤖 Generated with Claude Code

…e (gallery 4.0.0)

Themes minimal, classic and bold gain `variants` (light, light-alt, dark, dark-alt), each the value of core 0.23.0's `design.variant`: a background slot, or { background, accents } with an accent order, a map over the theme's one color scheme. The separate `dark` theme is removed (major: a removed id). Development pins move to the published opf and opf-render 0.22.2, so the six layout previews whose drawing changed since 0.19 are regenerated. README, CHANGELOG and CONTRIBUTING updated; test/records.test.mjs checks every theme's variants.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@michaeljgrimm

Copy link
Copy Markdown
Contributor Author

Validated against merged core #732: all 12 theme variants[].variant values (4 each for minimal, classic and bold) pass core main's design.variant schema (ThemeBackgroundSlot or ColorVariant, from spec/schemas/opf.schema.json), 0 invalid. Core's theme record schema (spec/schemas/theme.schema.json) still has no variants property, as noted in the description.

- Pin @openpresentation/opf and opf-render 0.23.0 (package.json, package-lock.json, CONTRIBUTING).
- Redraw the seven layout previews the 0.23.0 engines draw differently (scheme-derived borders, gridlines, axis lines, chart text and code colors): chart, chart-beside, code, dashboard, table, table-beside, timeline.
- Validate each theme's variants[].variant with core's normalizeColorVariant and isColorVariant.
- CHANGELOG 4.0.0 section names 0.23.0 and the redrawn previews.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@michaeljgrimm
michaeljgrimm merged commit cc137fd into main Oct 19, 2026
1 check passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant