Bug: undefined data.mode in hero:theme listener causes ReferenceError #7

Closed
opened 2026-03-06 22:40:15 +00:00 by mik-tf · 0 comments
Owner

Description

The admin dashboard (src/channels/admin.ts) needs a hero:theme postMessage listener so it can sync dark/light mode and CSS custom properties when embedded as an iframe inside Hero OS.

What it does

  • Listens for hero:theme messages from the Hero OS shell
  • Sets CSS custom properties (--var) on document.documentElement
  • Toggles light/dark class and data-bs-theme attribute for Bootstrap 5.3 compatibility
  • Sends hero:theme-ready signal back to parent when loaded in iframe

PR

## Description The admin dashboard (`src/channels/admin.ts`) needs a `hero:theme` postMessage listener so it can sync dark/light mode and CSS custom properties when embedded as an iframe inside Hero OS. ## What it does - Listens for `hero:theme` messages from the Hero OS shell - Sets CSS custom properties (`--var`) on `document.documentElement` - Toggles `light`/`dark` class and `data-bs-theme` attribute for Bootstrap 5.3 compatibility - Sends `hero:theme-ready` signal back to parent when loaded in iframe ## PR - #9
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_shrimp#7
No description provided.