Skip to content

Aspect Ratio

Utility classes for controlling the aspect ratio of elements using the native CSS aspect-ratio property.


Available Ratios

ClassRatioUse case
aspect-square1 / 1Avatars, icons
aspect-video16 / 9Video embeds
aspect-cinema21 / 9Cinematic banners
aspect-photo4 / 3Photo thumbnails
aspect-portrait3 / 4Portrait cards
aspect-golden1.618 / 1Golden ratio
aspect-wide2 / 1Hero banners
aspect-ultra-wide32 / 9Ultra-wide panels
1:1
4:3
16:9
2:1
3:4

Custom Aspect Ratio

Use the aspect-custom class with the --aspect-ratio CSS custom property for any ratio:

3:2
5:4

Responsive Variants

All classes support breakpoint prefixes: sm:, md:, lg:, xl:, 2xl:.

Square on mobile, 16:9 from md up

SCSS

scss
@use '@grundtone/design-tokens/scss/lib' as gt;

.hero {
  aspect-ratio: 21 / 9;

  @include gt.media-breakpoint-down('md') {
    aspect-ratio: 16 / 9;
  }
}