feat: add opt-in fullscreen lightbox primitive#1980
Merged
Conversation
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.
✅ Deploy Preview for gethinode-demo ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
|
🎉 This PR is included in version 2.16.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds a generic, opt-in lightbox primitive: any shortcode/partial can render a trigger that opens content in a full-screen overlay.
<dialog>+showModal()shell (assets/lightbox.html), rendered server-side once per page, gated on alightboxmodule dependency — so it's zero-cost on pages that don't use it. Top-layer rendering escapesoverflow:hidden/z-index issues.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 aMutationObserver. The clone strips nested triggers and observer-init markers so enhancements (e.g. mermaid pan/zoom) re-attach.assets/lightbox-trigger.html) for arbitrary content.components/_lightbox.scss): near-viewport sizing, dimmed::backdrop,prefers-reduced-motiongate,$theme-border-radiuscorners.lightboxClose,lightboxLabel,lightboxExpand) + parameterized icons viaGetThemeIcon.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 thelightboxdependency (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