fix(registry): clear brand CSS custom properties on unbranded re-attach; remove dead italic path

hfApplyStageConfig (Block B, verbatim across all 5 retrofitted caption
identities) only ever set --hf-caption-primary/--hf-caption-accent when the
corresponding brand.primaryColor/accentColor key was present, with no else
branch to clear it when absent. Re-attaching a brand-less payload after a
branded one left the custom property (and any JS-cached color derived from
it, e.g. caption-pill-karaoke's hfColorActive and caption-emoji-pop's
hfAccentColors) stuck at the stale value instead of reverting to the CSS
fallback, violating idempotent re-attach.

Also removes caption-editorial-emphasis's dead .word--italic CSS rule and
CLASS_MAP.i entry — hfMakeBlocks only ever emits "n"/"e" tags, "i" was only
reachable via the old hand-authored BLOCKS literal this task replaced.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
vanceingalls
2026-07-24 00:03:46 +00:00
co-authored by Claude Sonnet 5
parent 5af6203ae7
commit 4f69947191
5 changed files with 21 additions and 8 deletions
@@ -95,13 +95,6 @@
font-style: normal;
}
.word--italic {
font-family: "Inter", sans-serif;
font-size: 86px;
font-weight: 400;
font-style: italic;
}
.word--emphasis {
font-family: "Playfair Display", serif;
font-size: 180px;
@@ -236,9 +229,13 @@
var brand = (data && data.brand) || {};
if (typeof brand.primaryColor === "string" && brand.primaryColor) {
root.style.setProperty("--hf-caption-primary", brand.primaryColor);
} else {
root.style.removeProperty("--hf-caption-primary");
}
if (typeof brand.accentColor === "string" && brand.accentColor) {
root.style.setProperty("--hf-caption-accent", brand.accentColor);
} else {
root.style.removeProperty("--hf-caption-accent");
}
return { W: W, H: H, scaleX: W / 1920, scaleY: H / 1080, fontScale: Math.min(W, H) / 1080 };
}
@@ -415,7 +412,7 @@
return minSize;
}
var CLASS_MAP = { n: "word word--normal", i: "word word--italic", e: "word word--emphasis" };
var CLASS_MAP = { n: "word word--normal", e: "word word--emphasis" };
var W = [];
var BLOCKS = [];