Skip to content

Fix squat YouTube embeds by releasing the oEmbed height attribute - #15

Merged
amrtgaber merged 1 commit into
mainfrom
fix-embed-aspect-ratio
Jul 20, 2026
Merged

Fix squat YouTube embeds by releasing the oEmbed height attribute#15
amrtgaber merged 1 commit into
mainfrom
fix-embed-aspect-ratio

Conversation

@amrtgaber

Copy link
Copy Markdown
Contributor

Summary

YouTube embeds in Ghost posts rendered as full-width strips ~113px tall instead of 16:9 players.

Root cause: Ghost's kg-embed-card HTML keeps the provider's oEmbed width/height attributes on the iframe. Our .prose-ghost .kg-embed-card iframe rule applied aspect-video w-full, but CSS aspect-ratio only applies while the height computes to auto — the iframe's height attribute acts as an explicit height (a UA presentational hint), so the ratio was silently ignored.

Fix: add h-auto to the rule so author CSS releases the attribute height and aspect-video governs.

Testing

  • Verified on a real post against production Ghost content: embed iframe now measures 720×405 (exact 16:9) in light and dark modes; previously ~720×113.

Ghost's embed cards carry the fixed width/height attributes from the
provider's oEmbed response. The existing rule set aspect-video and w-full
on the iframe, but CSS aspect-ratio is ignored while the element has an
explicit height — the attribute height acted as one, so embeds rendered
as full-width strips ~113px tall. Adding h-auto lets aspect-video govern
and embeds render at a proper 16:9.
@netlify

netlify Bot commented Jul 20, 2026

Copy link
Copy Markdown

Deploy Preview for treepolitics-web ready!

Name Link
🔨 Latest commit 62ce069
🔍 Latest deploy log https://app.netlify.com/projects/treepolitics-web/deploys/6a5ea335afb4410008e9a4d1
😎 Deploy Preview https://deploy-preview-15--treepolitics-web.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@amrtgaber
amrtgaber merged commit e875dd3 into main Jul 20, 2026
6 checks passed
@amrtgaber
amrtgaber deleted the fix-embed-aspect-ratio branch July 20, 2026 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant