vimeo / player.js

Interact with and control an embedded Vimeo Player.
https://player.vimeo.com/api/demo
MIT License
1.43k stars 261 forks source link

player iframe background is not transparent when the parent document has a different `color-scheme` #950

Closed dyc3 closed 6 months ago

dyc3 commented 1 year ago

Expected Behavior

The iframe background should always be transparent.

Actual Behavior

In browsers, whenever the root document has a color-scheme that is different from the embedded document, the background of the embedded document will become forcibly opaque.

From my research, it might be possible to have the iframe inherit the color scheme of the parent if the child iframe has this style:

html {
    color-scheme: light dark;
}

These may be useful:

Steps to Reproduce

See my codepen: https://codepen.io/dyc3/pen/ZEVbZbE