Skip to content

When loading page the player background is briefly transparent with layout shift #1031

Answered by luwes
rlaphoenix asked this question in Q&A
Discussion options

You must be logged in to vote

related #904

for prevent cumulative layout shift see https://www.media-chrome.org/docs/en/prevent-layout-shift

if you have direct access to the element it's best not to use the CSS var --media-background-color because that will only become available once the JS has loaded. use CSS like:

media-controller {
  background-color: yellow;
}

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@luwes
Comment options

luwes Dec 4, 2024
Maintainer

Comment options

You must be logged in to vote
0 replies
Answer selected by luwes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1023 on December 04, 2024 19:53.