Skip to content

Latest commit

 

History

History
483 lines (354 loc) · 61.1 KB

design-resolution.md

File metadata and controls

483 lines (354 loc) · 61.1 KB

Design Resolution

How an engine decides the effective design for any given slide. The schema spreads these rules across field descriptions; this page states them once, as an algorithm.

Precedence

For every design field independently, the most specific source wins:

  wins   +--------------------------------------------------------+
    ^    | 1. slide design     slides[i].design.*                 |
    |    +--------------------------------------------------------+
    |    | 2. deck design      design.* on the presentation root  |
    |    +--------------------------------------------------------+
    |    | 3. resolved theme   colorScheme, fontScheme,            |
    |    |                     background, dimensions from the     |
    |    |                     theme record                        |
    |    +--------------------------------------------------------+
  loses  | 4. engine defaults  e.g. spec/reference/                |
    v    |                     engine-defaults.json                |
         +--------------------------------------------------------+
  1. Slide design — slides[].design.*
  2. Deck design — design.* on the presentation root
  3. Resolved theme — defaults carried by the theme record (colorScheme, fontScheme, background, dimensions)
  4. Engine defaults — spec/reference/engine-defaults.json, compiled into core as ENGINE_DEFAULT_THEME, ENGINE_DEFAULT_COLOR_SCHEME and ENGINE_DEFAULT_FONT_SCHEME

Resolution is per field, not per object. A slide that sets only design.contentAlignment inherits everything else from the deck design; a deck that sets only design.colorScheme keeps the theme's font scheme and background.

Two field-level rules complete the picture:

  • Base-plus-overrides within one object. Wherever a reference object carries an id (ColorScheme, FontScheme, and the inline Audience, Purpose and Tone), the id resolves a catalog record as the base and sibling fields override the resolved record per key. design.theme is a reference string only. The string shorthand ("colorScheme": "cool-horizon") is equivalent to setting only id.

    "colorScheme": { "id": "cool-horizon", "accent1": "#0F4C81" }
    
       catalog record "cool-horizon"        sibling fields on the object
       accent1: "#2874A6"   <-- replaced -- accent1: "#0F4C81"
       accent2: "#1B4F72"   <-- kept
       light1:  "#FFFFFF"   <-- kept
                    |
                    v
       effective scheme: accent1 from the override, everything else
       from the record
    
  • Explicit suppression. watermark, header, and footer accept false to switch off an inherited value — distinct from omitting the field, which inherits.

Every reference inside this chain resolves the one way every content reference does: catalogs.custom, then the records embedded under catalogs.default, then the catalog the host registered for its source (name:id in catalogs.<name>, then the host catalog for its source); see how-opf-works.md and the catalogs page.

Worked example 1: color scheme through every level

{
  "design": {
    "theme": "classic",
    "colorScheme": "forest-green"
  },
  "slides": [
    { "title": "Inherits the deck" },
    {
      "title": "Slide override",
      "design": {
        "colorScheme": { "id": "cool-horizon", "accent1": "#0F4C81" }
      }
    }
  ]
}
  • Slide 1: the classic theme record supplies its own default color scheme, but the deck design sets colorScheme explicitly, so forest-green wins (level 2 beats level 3). Fonts, background, and dimensions still come from classic.
  • Slide 2: slide design beats deck design (level 1 beats level 2). The cool-horizon record resolves as the base, then accent1 is replaced by #0F4C81. All other cool-horizon slots survive.

There is no ambiguity between "override" and "reference": every scheme value is a reference, and any sibling fields on the same object are overrides applied after the reference resolves.

Worked example 2: backgrounds and suppression

{
  "design": {
    "theme": "minimal",
    "background": "light1",
    "footer": {
      "start": { "text": "Acme Corp" },
      "end": { "text": "{{slide.number}}" }
    }
  },
  "slides": [
    { "title": "Light slide on a theme that defaults to dark" },
    {
      "title": "Section divider",
      "design": {
        "background": {
          "type":