fix(player): the YouTube player keeps its size on a short window and when maximised
Two layout bugs since the player grew a side panel, both reported from prod. Maximised (F) on a wide window, the video was a thin line across the screen: the side-panel layout aligns the stage `self-start`, and Chrome applies a flex item's self-alignment to an absolutely positioned box too, so the fixed stage took its content's height — 0 px. The maximised stage now stretches between its insets whatever the layout asks of it. On a short window under 1280 px (a laptop at 100%, a 1080p screen at 175%) only the side strips were left: the card narrows so the chrome under the video fits, but that chrome grows as the card narrows (its text wraps), and the loop ran the card down to 2 px. The video now never goes narrower than 36rem to make room; past that the card scrolls. Measured before/after (localdev, real YouTube iframe): 1097×520 open 0×0 → 610×343; 1920×911 maximised 1920×0 → 1920×911; 1440×760 and 1366×650 maximised fill the window; leaving maximise restores the card. Held by an e2e test at both sizes (red on the old code: 0 px wide, and 911 ≠ 0), green on Chrome, WebKit and iPad.
This commit is contained in:
@@ -1176,6 +1176,12 @@ html[data-theme="light"] {
|
||||
.player-stage--max {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
/* Stretched between the insets, whatever the layout asks of the in-flow stage: the side-panel
|
||||
layout aligns it `self-start`, and Chrome applies a flex item's self-alignment to an absolutely
|
||||
positioned box too — the fixed stage then took its content's height, 0 px (its content is all
|
||||
absolutely positioned): a thin line across the window instead of the video. */
|
||||
align-self: stretch;
|
||||
justify-self: stretch;
|
||||
/* rail level: this stage only has to beat the modal chrome it is nested inside (whose own
|
||||
children top out at the menu level). The modal root is a z-overlay stacking context, so nothing
|
||||
here escapes it — a higher level would claim an authority this layer neither has nor needs. */
|
||||
|
||||
Reference in New Issue
Block a user