From e6fba28b66e1a68a42d9cdf51f7442f67dbae211 Mon Sep 17 00:00:00 2001 From: jbernard077 Date: Sat, 24 Oct 2026 00:43:31 +0000 Subject: [PATCH] fix(registry): centre mk-callout-highlight with flex instead of a script-time measurement (#5118) * fix(registry): centre mk-callout-highlight with flex instead of a script-time measurement The text box becomes a flex item of a full-frame wrapper (#mk-ch-center), so its position is laid out by the browser rather than read from a getBoundingClientRect() taken at script time. That measurement depends on which font faces are loaded when the script runs; the fonts gate covers only faces that static markup already uses, so script-built text measures against the fallback face (#5112). A non-null CONFIG.x / CONFIG.y becomes a margin offset on that axis. The GSAP y entrance stays on the box, which carries no CSS transform. Also drops the scene-exit visibility tail (the runtime hides the clip at its window end; the 0.02 s tail never reached a frame at 30 fps) and removes data-layout-allow-occlusion from #mk-ch-box: nothing beneath the block is text, and the attribute made the contrast audit skip the block's own words whenever a later full-frame host answered the hit-test probe. Renders are bit-identical to the measured version when the face is loaded (nine-scene project at v0.8.135, 1380/1380 frames). CONFIG and the sweep mechanic are unchanged. Co-Authored-By: Claude Fable 5.1 * fix(registry): keep only the flex centring in mk-callout-highlight Address review: restore the scene-exit visibility tail and the layout occlusion attribute, which belong to family-wide conventions and are out of scope here, and note the x + maxWidth clip edge in CONFIG. Refs #5112 Co-Authored-By: Claude Fable 5.1 --------- Co-authored-by: Claude Fable 5.1 --- .../mk-callout-highlight.html | 44 +++++++++++++++---- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/registry/blocks/mk-callout-highlight/mk-callout-highlight.html b/registry/blocks/mk-callout-highlight/mk-callout-highlight.html index f1176a4629..626473ca1a 100644 --- a/registry/blocks/mk-callout-highlight/mk-callout-highlight.html +++ b/registry/blocks/mk-callout-highlight/mk-callout-highlight.html @@ -30,8 +30,20 @@ overflow: hidden; background: transparent; /* overlays footage or mk-background */ } - #mk-ch-box { + #mk-ch-center { + /* CSS centring. The box is a flex item of this full-frame wrapper, so its + place is laid out by the browser rather than measured from a DOM rect + taken before web fonts are ready. An explicit CONFIG.x / CONFIG.y turns + that axis into an edge offset (see the script). No pointer-events:none + here: it inherits to the word spans and the contrast audit skips them. */ position: absolute; + inset: 0; + display: flex; + align-items: center; + justify-content: center; + } + #mk-ch-box { + flex: none; /* max-content width, clamped by max-width; never shrunk */ font-family: var(--mk-font); font-weight: 500; letter-spacing: -0.015em; @@ -50,7 +62,9 @@ data-width="1920" data-height="1080" > -
+
+
+