From a2468329bf097b03bfe3055cef00ea699911d0bc Mon Sep 17 00:00:00 2001 From: SandObserver <260779319+SandObserver@users.noreply.github.com> Date: Sun, 20 Sep 2026 00:41:18 -0400 Subject: [PATCH] Pin the preview card to the widget's own manifest A widget with no light design rendered light on a light docs page. The card and the dark-only flag now come from the widget manifest, and the preview card colours match the product's. --- src/components/WidgetGroup.astro | 8 +++++-- src/components/WidgetPreview.astro | 8 +++++-- src/lib/widget-manifest.ts | 19 +++++++++++++++ src/styles/docs.css | 37 +++++++++++++++++------------- 4 files changed, 52 insertions(+), 20 deletions(-) create mode 100644 src/lib/widget-manifest.ts diff --git a/src/components/WidgetGroup.astro b/src/components/WidgetGroup.astro index d1e73b1..fec794b 100644 --- a/src/components/WidgetGroup.astro +++ b/src/components/WidgetGroup.astro @@ -1,11 +1,13 @@ --- +import { manifestCard } from '../lib/widget-manifest'; + /* Geometry must match WidgetPreview. See the note there. */ interface Item { type: string; file: string; id: string; size?: 'small' | 'medium'; - card?: 'dark' | 'light' | 'translucent' | null; + card?: 'dark' | 'graphite' | 'light' | 'translucent' | null; title: string; label?: string; } @@ -37,6 +39,7 @@ const built = items.map((it) => { tx: (w - dw * scale) / 2, ty: (CARD_H - dh * scale) / 2, src: `/widgets/${it.type}/${it.file}?id=${encodeURIComponent(it.id)}&size=${size}&lang=en`, + declared: manifestCard(it.type, it.file), }; }); --- @@ -49,7 +52,8 @@ const built = items.map((it) => {