Problem: Embeds that keep aspect ratio.

Solution#

html
<div class="aspect-video w-full overflow-hidden rounded-xl">
  <iframe class="h-full w-full" src="…"></iframe>
</div>

Why this works#

aspect-video (16/9) is the native solution — no padding-top hacks.

Variants#

  • Responsive: add screen prefixes to the core classes
  • Dark: pair each color utility with its dark: twin
  • Animated: add transition + a state variant for motion

cookbook/index|Cookbook index · utilities/index|Utilities reference · patterns/index|Layout patterns