Skip to content

Commit

Permalink
🐛 Fix amp-story-captions layout and fix max-height of `amp-story-…
Browse files Browse the repository at this point in the history
…grid-layer`

`amp-story-captions` adds caption in shadow-dom. Thus, parent `div` container of the `amp-story-captions` won't reflect the actual size of the `amp-story-captions`.

This will fix this issue by setting `max-height` of the `amp-story-grid-layer.align-bottom` exactly to the shadow-dom component.

Additionally, fixed-height layout of the `amp-story-captions` is changed to container in order to occupy only required space.
  • Loading branch information
AnuragVasanwala committed Oct 18, 2023
1 parent 68e6503 commit 11a2b72
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/output/src/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,13 @@ function OutputPage({
aspect-ratio={ASPECT_RATIO}
class="grid-layer align-bottom"
>
<div className="captions-area">
{/* `backgroundColor` is added only for testing purpose. */}
<div className="captions-area" style={{ backgroundColor: 'blue' }}>
{videoCaptions.map((captionId) => (
<amp-story-captions
key={captionId}
id={captionId}
layout="fixed-height"
height="100"
layout="container"
/>
))}
</div>
Expand Down
1 change: 1 addition & 0 deletions packages/output/src/utils/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ function CustomStyles() {
amp-story-grid-layer.align-bottom {
align-content: end;
padding: 0;
max-height: calc(100vh - 148px);
}
.captions-area {
Expand Down

0 comments on commit 11a2b72

Please sign in to comment.