Skip to content

Instantly share code, notes, and snippets.

@wplit
Created June 19, 2025 01:44
Show Gist options
  • Save wplit/ae7af27c7919c9f456b3dd4742249b0b to your computer and use it in GitHub Desktop.
Save wplit/ae7af27c7919c9f456b3dd4742249b0b to your computer and use it in GitHub Desktop.
example CSS for moving aspect-ratio onto media-provider inside player
/* remove aspect ratio from player and set variable for controlling top margin */
%root% {
aspect-ratio: unset;
--player-controls-top: 6rem;
}
/* add aspect ratio to the media provider and set margins */
%root% media-provider {
position: relative;
aspect-ratio: 16 / 9;
margin-top: var(--player-controls-top);
margin-left: 5%;
margin-right: 5%;
width: 90%;
}
/* make sure buffer indicator remains centered */
%root% .xmp-buffering-indicator {
top: var(--player-controls-top);
bottom: 0;
height: unset;
}
/* force controls to remain visible & remove gradient */
%root% media-controls {
background: none;
opacity: 1;
visibility: visible;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment