Skip to content

Implement aspect-ratio property #32802

Open

Description

@valadaptive

Describe the bug:

Implement the CSS aspect-ratio property, described at https://drafts.csswg.org/css-sizing-4/#aspect-ratio.

Current status:

Activity

  1. added
    C-untriaged
    on Jul 18, 2024
  2. freyacodes commented on Feb 11, 2026

    @freyacodes
    Member

    I have been reading through the layout component with an eye towards implementing aspect-ratio in non-replaced elements. Would you be open to me taking a stab at implementing that?

  3. mrobinson commented on Feb 11, 2026

    @mrobinson
    Member

    Hi @freyacodes, thanks for your interest! Layout is currently undergoing a lot of architectural work, so the main folks working on layout are going to have limited to review and mentor a big project like this. I would suggest maybe picking something more in the realm of DOM / Script which has more reviewers and has a greater deal of abstraction between parts.

  4. added
    A-layout/2020
    and removed
    C-untriaged
    on Jul 30, 2026
  5. jdm commented on Sep 28, 2026

    @jdm
    Member

    Sample non-replaced testcase:

    <style>
    div {
      width: 300px;
    }
    figure {
      aspect-ratio: 16 / 9;
    }
    img {
      width: 100%;
      height: 100%;
    }
    </style>
    <div><figure><img src="https://fosseryweb.codeberg.page/-assets/logo.jpg"></figure></div>

    Firefox/Chrome:

    Image

    Servo:

    Image
  6. added
    B-feature-tracking
    on Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-layout/2020B-feature-tracking

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions