Skip to content

feat: add opt-in fullscreen lightbox primitive#1980

Merged
markdumay merged 9 commits into
mainfrom
feat/lightbox-primitive
Jul 4, 2026
Merged

feat: add opt-in fullscreen lightbox primitive#1980
markdumay merged 9 commits into
mainfrom
feat/lightbox-primitive

Conversation

@markdumay

Copy link
Copy Markdown
Collaborator

Summary

Adds a generic, opt-in lightbox primitive: any shortcode/partial can render a trigger that opens content in a full-screen overlay.

  • Native <dialog> + showModal() shell (assets/lightbox.html), rendered server-side once per page, gated on a lightbox module dependency — so it's zero-cost on pages that don't use it. Top-layer rendering escapes overflow:hidden/z-index issues.
  • JS module (assets/js/modules/lightbox/lightbox.mjs): binds [data-lightbox-trigger] elements, clones the trigger's resolved source (data-lightbox-source / data-lightbox-source-closest) into the dialog, and handles close (button / Esc / backdrop), focus-return, and dynamically-added triggers via a MutationObserver. The clone strips nested triggers and observer-init markers so enhancements (e.g. mermaid pan/zoom) re-attach.
  • Convenience trigger partial (assets/lightbox-trigger.html) for arbitrary content.
  • SCSS (components/_lightbox.scss): near-viewport sizing, dimmed ::backdrop, prefers-reduced-motion gate, $theme-border-radius corners.
  • i18n (lightboxClose, lightboxLabel, lightboxExpand) + parameterized icons via GetThemeIcon.
  • exampleSite demo page + shortcode.

Contract (decoupled by design)

Consumers opt in purely via markup + a module dependency — no cross-module partial calls. A consumer emits a [data-lightbox-trigger] button and registers the lightbox dependency (utilities/AddModule.html); everything else is core.

Verification

exampleSite builds clean; browser-verified open/clone/close (button/Esc/backdrop), focus-return, no content accumulation across re-opens, and correct icon-sprite collection (the shell renders before assets/symbols.html). First consumer is a mod-mermaid fullscreen control (separate PR); degrades gracefully until this is released.

🤖 Generated with Claude Code

markdumay added 8 commits July 4, 2026 13:10
Render the lightbox shell before assets/symbols.html so its close icon
(lightboxClose) is registered before the FontAwesome sprite is emitted.
Previously the shell rendered after the sprite, so #fas-xmark was missing
and the close button drew nothing (invisible in light and dark mode).
Match Hinode's corner convention ($theme-border-radius, as used by navbar,
carousel, docs, syntax, kbd, timeline) instead of the raw Bootstrap
--bs-border-radius variable, so the dialog follows theme customization.
@netlify

netlify Bot commented Jul 4, 2026

Copy link
Copy Markdown

Deploy Preview for gethinode-demo ready!

Name Link
🔨 Latest commit cf565b6
🔍 Latest deploy log https://app.netlify.com/projects/gethinode-demo/deploys/6a4940e9398ede00080aaceb
😎 Deploy Preview https://deploy-preview-1980--gethinode-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@markdumay markdumay enabled auto-merge July 4, 2026 17:20
@markdumay markdumay merged commit c41efdf into main Jul 4, 2026
15 checks passed
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 2.16.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant