Created
June 19, 2025 01:44
-
-
Save wplit/ae7af27c7919c9f456b3dd4742249b0b to your computer and use it in GitHub Desktop.
example CSS for moving aspect-ratio onto media-provider inside player
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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