# Fixed-Stage Rules — oma-slide > The canonical reference for the 1920×1080 stage model, embedding instructions, px-authoring > conventions, and the CJK → Pretendard rule. ## 1. The 1920×1080 Invariant All slides are authored at exactly **1920 × 1080 px**. This is non-negotiable: - The validator (`oma slide validate`) renders at 1920×1080 and checks geometry at that size; it reports px→pt at 0.75 (1920×1080 px → 1440×810 pt at 96 dpi / 72 pt-per-inch). - The exporter (`oma slide export pdf|png`) captures at 1920×1080 before any post-processing. - PPTX export places each rasterized slide full-bleed on a LAYOUT_WIDE canvas (13.333 in × 7.5 in = 960×540 pt) — pixel authoring only, no pt in HTML. - Do **not** author in percentages, `vw/vh`, or responsive units that reflow the layout. Fixed `px` values only inside `.slide`. ``` Canvas size: 1920 px wide × 1080 px tall Aspect ratio: 16:9 Validator pt: 1440 pt wide × 810 pt tall (px × 0.75) PPTX layout: 13.333 in × 7.5 in (960×540 pt) — raster placed full-bleed ``` ## 2. Stage Scaling — How It Works `deck-stage.js` computes: ```js const scale = Math.min(viewportWidth / 1920, viewportHeight / 1080); ``` Then positions the `.deck-stage` element so it is centred (letterbox / pillarbox): ```js offsetLeft = (viewportWidth - 1920 * scale) / 2 offsetTop = (viewportHeight - 1080 * scale) / 2 stageEl.style.transform = `scale(${scale})`; stageEl.style.left = `${offsetLeft}px`; stageEl.style.top = `${offsetTop}px`; ``` `transform-origin` is `top left` (set in `viewport-base.css`). This keeps the maths simple and avoids a secondary translate. The viewport background (`#000` default) fills the letterbox/pillarbox bars. You can change the background color of `.deck-viewport` in a theme without breaking the scale maths. ## 3. Embedding into a Deck Paste or link the two shared assets into every deck's ``. The `oma slide create` command copies them into the workdir automatically; `oma slide bundle` inlines them into the single-file output. ### Option A — External files (development / per-slide workdir) ```html
``` ### Option B — Inlined (single-file bundle — `out/deck.html`) `oma slide bundle` inlines both files; the structure is the same but the `` is replaced by `` and ``. ### Optional: nav controls + slide counter `deck-stage.js` looks for existing `.deck-nav` and `.deck-counter` elements. If none are present the viewer still works (keyboard/touch/wheel only). For `viewer.html`, the CLI injects: ```html
``` ## 4. px-Authoring Conventions | Element | Convention | |---|---| | Slide root | `position: absolute; inset: 0; width: 1920px; height: 1080px;` | | Safe zones | Left/right margin ≥ 80px; top/bottom margin ≥ 60px | | Body text | 28–36 px doctrine floor; heading 64–120 px. (The validator hard-fails only below 18 px — 18–27 px passes the gate but is reserved for captions/labels.) | | Icon / decorative image | explicit `width`/`height` in px | | Background gradients | allowed (CSS); rasterized to PNG at PPTX export | | Clipping / overflow | `overflow: hidden` on `.slide` prevents bleed-out | | Animations | `transform` + `opacity` only | ### 8-px Grid Align all spacing, padding, and element positions to multiples of 8 px. This keeps designs crisp at all scale factors and maps cleanly to pt at PPTX export. ### Z-index layers ``` 0 background layer (solid color, image, gradient) 10 atmosphere layer (subtle overlay, texture) 100 content layer (text, charts, icons) 200 highlight layer (callouts, badges) 1000 overlay layer (modal-style content, reserved) ``` ## 5. Slide Visibility — Always Use .active / .visible **Never** toggle slides with `display:none` or `display:block`. Some layout classes from design themes may override that and reveal all slides at once. Use the CSS class protocol defined in `viewport-base.css`: | Class | Meaning | |---|---| | _(no class)_ | Hidden: `visibility:hidden; opacity:0; pointer-events:none` | | `.active` | Fully visible: `visibility:visible; opacity:1; pointer-events:auto` | | `.visible` | Fading out: `visibility:visible; opacity:0; pointer-events:none` | `deck-stage.js` manages these classes automatically. Slide authors do not need to set them. ## 6. Validator Contract `oma slide validate` (puppeteer-core) renders each slide file and: 1. Takes every `.slide` inside `.deck-stage` as a 1920×1080 frame. Without that structure it falls back to `` as one frame, so keep the canonical DOM from §3. 2. Runs every check on every frame: `no_overflowing_text`, `no_overlapping_text`, and `slide_sized_text` are critical; `remote_asset_ref` is a warning. 3. Reports findings as `{ code, message, slide, selector?, rect? }`. A text element is any element with its own non-empty text node. The checks cannot be switched off per slide or per element: text that extends past the frame is reported even when it is decorative or clipped by an ancestor's `overflow: hidden`. Keep such text inside the frame, or use an image instead of live text. `deck-stage.js` adds two labels to each `.slide` at runtime, and the scaffold writes the second one into the starter slide: ```html data-screen-label="Slide N / M" data-om-validate="no_overflowing_text,no_overlapping_text,slide_sized_text" ``` They name the slide and the gate's critical checks. The validator does not read them, so leave them as written; adding, editing, or removing one changes nothing about what is checked. `remote_asset_ref` fires on every `http(s)` reference, which includes the font CDN ``s this skill requires (§7 and the presets' Google Fonts links). Those warnings are expected and never fail the gate; any other remote reference should move into `./assets/`. ## 7. CJK Content → Pretendard Required Any deck whose content contains Korean (한국어), Japanese (日本語), or Chinese (中文) characters **must** include Pretendard Variable as the primary font. ```html ``` CSS font-family for CJK decks: ```css :root { --font-body: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Noto Sans JP", "Noto Sans SC", sans-serif; --font-display: "Pretendard Variable", Pretendard, sans-serif; } ``` For latin-only decks, distinctive display fonts are encouraged (anti-"AI slop"): system-font-stack restriction applies only to the **body** font fallback, not to the chosen heading/display typeface. ## 8. Print / Save-as-PDF Trigger with `Ctrl+P` / `Cmd+P` in the browser, or use `oma slide export pdf --mode print`. `deck-stage.js` removes the CSS transform before the print layout renders, so the browser sees the true 1920×1080 px layout. `viewport-base.css` `@media print` rules: - Remove `.deck-viewport` overflow/fixed positioning. - Remove transform from `.deck-stage`. - Make all `.slide` elements visible with `break-after: page`. - Hide `.deck-nav` and `.deck-counter`. Result: one clean 1920×1080 slide per printed page. ## 9. Presenter View (embedded notes panel + postMessage API) The presenter view is an **embedded on-screen notes panel** — there is no separate presenter window. `deck-stage.js` reads speaker notes from `