From c14683fe37fabe06082f43e8bf67debc4cca7297 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Tue, 21 Jul 2026 14:24:59 +0200 Subject: Render asset credit inside the gallery lightbox correctly GLightbox's own selector-based description feature never actually resolved a selector in three different attempts -- literal text, then a resolved-but-empty div, then apparently not firing at all against the installed (unversioned) build. Replaced with a small afterSlideLoad handler that reads a plain data-credit-selector attribute and copies the real element's HTML into the slide's description area directly, depending only on GLightbox handing back a real DOM node per slide -- a much smaller contract than trusting its own caption-resolution feature. Renamed the credit div's class from glightbox-desc, since that name is reserved by the library's own bundled CSS (display: none !important) and can't be reliably overridden from here. Also: distinguishes the credit line and the "N Bilder" caption from ordinary body text (italic, muted, matching .author_and_date's existing convention), and makes the lightbox's caption card follow the site's light/dark toggle via Canvas/CanvasText, since the library's bundled theme never adapts to it on its own. --- public/stylesheets/ccc.css | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'public/stylesheets/ccc.css') diff --git a/public/stylesheets/ccc.css b/public/stylesheets/ccc.css index 8358d06c..96545949 100644 --- a/public/stylesheets/ccc.css +++ b/public/stylesheets/ccc.css @@ -727,7 +727,6 @@ div.teaser_ruler { min-width: 0; } - .inline-image--full { width: 100%; margin: 1rem 0; @@ -748,10 +747,31 @@ div.teaser_ruler { margin-left: 1rem; } -#asset_credits .glightbox-desc { +#asset_credits .asset_credit_block { display: none; } -#asset_credits .headline_credit { +#asset_credits .asset_credit_block.headline_credit { display: block; } + +#asset_credits { + border-top: dotted 1px silver; +} + +#asset_credits, +.right { + font-style: italic; + font-family: Georgia; + font-size: 0.9rem; + color: color-mix(in srgb, CanvasText, #808080); +} + +.glightbox-clean .gslide-description { + background: Canvas !important; +} + +.glightbox-clean .gslide-title, +.glightbox-clean .gslide-desc { + color: CanvasText !important; +} -- cgit v1.3