Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/components/ArticleImageLightbox.astro
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@

let activeTrigger: HTMLElement | null = null;

// VideoEmbed posters live in article content and must stay click-to-play.
// Enhancing them opens the lightbox over the iframe and hides the video.
const isEligibleArticleImage = (image: HTMLImageElement) =>
image.matches('main .sl-markdown-content img') &&
!image.closest('.not-content, #sl-kapa-panel, [data-no-lightbox]');
!image.closest('.not-content, #sl-kapa-panel, .video-embed, [data-no-lightbox]');
const isEligibleKapaImage = (image: HTMLImageElement, trigger: HTMLElement) =>
trigger.matches('.sl-kapa-answer-image-button') &&
image.matches('.sl-kapa-answer-image') &&
Expand Down
1 change: 1 addition & 0 deletions src/components/VideoEmbed.astro
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ const posterAlt = title || (kind === 'youtube' ? 'YouTube video' : '');
decoding="async"
width="640"
height="480"
data-no-lightbox
/>
<span class="video-embed__play" aria-hidden="true">
<svg viewBox="0 0 68 48" xmlns="http://www.w3.org/2000/svg">
Expand Down
5 changes: 3 additions & 2 deletions src/styles/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,9 @@ body {
}
/* Article images are enhanced by ArticleImageLightbox.astro with keyboard
dialog controls while this class adds a layout-neutral zoom affordance.
The script scopes enhancement to main docs content and honors
`data-no-lightbox` on the image or any ancestor. */
The script scopes enhancement to main docs content and skips VideoEmbed
posters plus anything marked with `data-no-lightbox` on the image or an
ancestor. */
.sl-markdown-content img[data-docs-image-lightbox-image] {
cursor: zoom-in;
transition: box-shadow 0.15s ease;
Expand Down
Loading