Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always display YouTube videos in 16:9 aspect ratio #27

Closed
AprilSylph opened this issue Apr 15, 2022 · 0 comments
Closed

Always display YouTube videos in 16:9 aspect ratio #27

AprilSylph opened this issue Apr 15, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@AprilSylph
Copy link
Owner

[data-block="video"] iframe[id="youtube_iframe"] {
height: calc(540px * (9/16));
}

This CSS assumes the video width is 540px, which is usually correct. However, post width can shrink according to the viewport. The universally correct value would be:

height: calc(min(100vw, 540px) * (9 / 16));
@AprilSylph AprilSylph added the enhancement New feature or request label Apr 15, 2022
@AprilSylph AprilSylph self-assigned this Apr 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant