This repository was archived by the owner on Nov 2, 2026. It is now read-only.
Repository navigation
RR-96: theme variants; the dark theme becomes a variant of every theme (4.0.0) - #10
Merged
Merged
Conversation
…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>
Contributor
Author
|
Validated against merged core #732: all 12 theme |
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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,classicandboldgainvariants: [{ id, name, variant }]withlight,light-alt,darkanddark-alt.variantis the value ofdesign.variant; a host applies a variant by writing it there. The variant whose background is the theme's ownbackgroundis the theme's look (Minimal's own isdark2, so itsdarkisdark2). 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.darktheme is removed. Dark is now a variant of every theme. Itsboostcolors withseafordfonts pairing is not kept as a theme: a document wanting it writescolorScheme: "boost",fontScheme: "seaford"and a dark variant (theboostandseafordrecords stay).test/records.test.mjschecks 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:stabilityfails a minor/patch release that removes an id. Addingvariantsalone would be a minor release (new data on existing records, no drawing changes); removing thedarktheme is what makes it major, as asked.CATALOG_SCHEMAstays 3.check:stabilityagainst 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.jsonandpackage-lock.jsoncarry 4.0.0; releasing follows CONTRIBUTING (release PR moves the changelog section, tagv4.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/opfandopf-render0.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 withnpm 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.jsonrecords their new sizes. The other 21 previews are unchanged;check:previewspasses.For core (not blocking this PR)
Core 0.23.0 has no
variantsproperty on the theme record schema (opf-theme/v1,spec/schemas/theme.schema.json); the schema has noadditionalProperties: falseat the root, so the records validate today, butvariantsand itsvariantvalue are not documented or checked by core. This PR checks eachvariantvalue with core'snormalizeColorVariantintest/records.test.mjs; core should addvariantsto the theme schema (variantas itsColorVariant/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 ciwith the 0.23.0 pins, thencheck:license,verify,npm test(114 pass),typecheck,check:previews,check:stability("OK: every existing record draws the same, or the release is major") andpack:dry-runall pass locally.test/records.test.mjsnow validates every theme'svariants[].variantwith core 0.23.0's ownnormalizeColorVariantandisColorVariant(exported from@openpresentation/opf/composition) instead of a hand-written shape check. Core 0.23.0's theme record schema still has novariantsproperty (see below), so the records are not yet schema-validated beyond that.🤖 Generated with Claude Code