Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
384a1dd262 |
@@ -213,11 +213,16 @@ export const EmbedMediaLandscape = style([
|
|||||||
{
|
{
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
width: '100%',
|
width: '100%',
|
||||||
aspectRatio: '16 / 9',
|
// 16:9 via the padding-top hack (56.25%), NOT `aspect-ratio`. An absolutely-
|
||||||
|
// positioned *replaced* element (the player <iframe>) collapses to its ~200px
|
||||||
|
// intrinsic size inside an `aspect-ratio` box; padding derives a definite height
|
||||||
|
// from the definite width so the iframe (inset:0) reliably fills it.
|
||||||
|
height: 0,
|
||||||
|
paddingTop: '56.25%',
|
||||||
overflow: 'hidden',
|
overflow: 'hidden',
|
||||||
backgroundColor: color.Surface.Container,
|
backgroundColor: color.Surface.Container,
|
||||||
selectors: {
|
selectors: {
|
||||||
'&:fullscreen': { width: '100vw', height: '100vh', aspectRatio: 'auto' },
|
'&:fullscreen': { width: '100vw', height: '100vh', paddingTop: 0 },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
@@ -228,12 +233,14 @@ export const EmbedMediaPortrait = style([
|
|||||||
position: 'relative',
|
position: 'relative',
|
||||||
width: toRem(300),
|
width: toRem(300),
|
||||||
maxWidth: '100%',
|
maxWidth: '100%',
|
||||||
aspectRatio: '9 / 16',
|
// 9:16 via the padding-top hack (177.78%) — see EmbedMediaLandscape.
|
||||||
|
height: 0,
|
||||||
|
paddingTop: '177.78%',
|
||||||
margin: '0 auto',
|
margin: '0 auto',
|
||||||
overflow: 'hidden',
|
overflow: 'hidden',
|
||||||
backgroundColor: color.Surface.Container,
|
backgroundColor: color.Surface.Container,
|
||||||
selectors: {
|
selectors: {
|
||||||
'&:fullscreen': { width: '100vw', height: '100vh', aspectRatio: 'auto', margin: 0 },
|
'&:fullscreen': { width: '100vw', height: '100vh', paddingTop: 0, margin: 0 },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|||||||
Reference in New Issue
Block a user