Skip to content

fix: theme the pip placeholder (no more black void) - #36

Merged
karngyan merged 1 commit into
mainfrom
fix/pip-placeholder-theme
Jul 24, 2026
Merged

fix: theme the pip placeholder (no more black void)#36
karngyan merged 1 commit into
mainfrom
fix/pip-placeholder-theme

Conversation

@karngyan

Copy link
Copy Markdown
Collaborator

Fixes the black placeholder reported in karnstack/karnstack#149.

What was wrong

mountPipPlaceholder mounts the layer shown inline where the stage was while playback runs in the document picture-in-picture window. Its rule hardcoded background: black with light copy, so on a light page (chromeTheme="light") the video frame turned into a black rectangle for the whole pip session.

The fix

  • Placeholder colors move to tokens: --kino-pip-fill, --kino-pip-card, --kino-pip-card-border, --kino-pip-text, --kino-pip-text-hover, --kino-pip-sub. Dark defaults are the values that shipped; the data-kino-theme="light" block overrides all six.
  • The icon + "playing in picture in picture" + "click to return" copy now sit in a small card (.kino-pip-placeholder-card), so on a light fill it reads as a panel instead of an empty frame.
  • --kino-pip-fill is a literal opaque color, not --kino-bg. The master media keeps playing underneath the placeholder, so a host that sets --kino-bg: transparent would otherwise see the still-playing stage through it. Hosts that want a different opaque fill can override the token.

Verification

  • pnpm test (204 passing), pnpm typecheck, pnpm lint, pnpm format:check.
  • New regression test asserts the placeholder paints only tokens and that the light block overrides each one with a non-black fill.
  • Eyeballed both themes against the built dist/styles.css in a browser (dark fill unchanged, light fill is a themed surface with dark copy).

Not in scope

The pip window itself still hardcodes a black body background and dark controls in mountPipOverlay; the chrome theme is not plumbed into the provider today. Worth a follow-up if light-theme pip windows should match.

The layer left inline while playback runs in the document picture-in-picture
window painted a hardcoded black fill with light copy, so it stayed a black
rectangle on a light page no matter what chromeTheme said.

Its colors are now tokens (--kino-pip-fill, --kino-pip-card,
--kino-pip-card-border, --kino-pip-text, --kino-pip-text-hover,
--kino-pip-sub) that the data-kino-theme="light" block overrides, and the
"playing in picture in picture" affordance moves into a small card so it
reads as a panel rather than an empty frame on a light surface. Dark values
are unchanged. --kino-pip-fill stays a literal opaque color rather than
--kino-bg: the master media keeps playing underneath the placeholder, so a
transparent fill would show it through.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
kino d7c893c Commit Preview URL

Branch Preview URL
Jul 24 2026, 05:57 PM

@karngyan
karngyan merged commit e40f729 into main Jul 24, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant