image + text-media: opt-in lightbox with native dialog #93

Closed
opened 2026-07-18 02:25:55 +02:00 by dominik.polakovics · 1 comment

What to build

An opt-in lightbox bool param (default false) on image.yaml and text-media.yaml. When enabled, each grid image is wrapped in an anchor to the full-size asset; a small dependency-free theme script upgrades that anchor into an in-page overlay using native <dialog>: Esc and backdrop close, prev/next navigation within the same grid, focus returned to the trigger on close.

Progressive enhancement: with JS unavailable the anchor simply opens the full-size image. Per-image rule: if the img child's link param is set, that link always wins over the lightbox for that image.

Acceptance criteria

  • lightbox bool param on both sidecars, default false; existing content unaffected when omitted
  • Theme script is dependency-free, only loaded/active when a lightbox grid is on the page
  • <dialog> overlay: Esc + backdrop close, prev/next within grid, focus restore, alt text carried into the enlarged view
  • img.link set → that image navigates to the link, never opens the lightbox
  • No-JS fallback: anchor opens the full-size asset
  • Publish via real Hugo build; keyboard-only operation verified

Blocked by

None - can start immediately

## What to build An opt-in `lightbox` bool param (default false) on `image.yaml` and `text-media.yaml`. When enabled, each grid image is wrapped in an anchor to the full-size asset; a small dependency-free theme script upgrades that anchor into an in-page overlay using native `<dialog>`: Esc and backdrop close, prev/next navigation within the same grid, focus returned to the trigger on close. Progressive enhancement: with JS unavailable the anchor simply opens the full-size image. Per-image rule: if the `img` child's `link` param is set, that link always wins over the lightbox for that image. ## Acceptance criteria - [ ] `lightbox` bool param on both sidecars, default false; existing content unaffected when omitted - [ ] Theme script is dependency-free, only loaded/active when a lightbox grid is on the page - [ ] `<dialog>` overlay: Esc + backdrop close, prev/next within grid, focus restore, alt text carried into the enlarged view - [ ] `img.link` set → that image navigates to the link, never opens the lightbox - [ ] No-JS fallback: anchor opens the full-size asset - [ ] Publish via real Hugo build; keyboard-only operation verified ## Blocked by None - can start immediately
Author
Owner

This was generated by AI during triage.

Triage confirmed — enhancement, ready-for-agent. The issue body is the authoritative agent brief.

Verified against the codebase: both target sidecars exist and share the same img items collection, so one param + one anchor-wrapping rule covers both. The img.link-wins precedence rule is well-defined against img.yaml's existing params. The theme already ships a small first-party script pattern (video-embed facade) to model the dependency-free loader on.

> *This was generated by AI during triage.* **Triage confirmed — enhancement, ready-for-agent.** The issue body is the authoritative agent brief. Verified against the codebase: both target sidecars exist and share the same `img` items collection, so one param + one anchor-wrapping rule covers both. The `img.link`-wins precedence rule is well-defined against `img.yaml`'s existing params. The theme already ships a small first-party script pattern (video-embed facade) to model the dependency-free loader on.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Cloonar/deckle#93
No description provided.