Re: [csswg-drafts] [Proposal] Support styling based on an element’s intrinsic aspect ratio (or size) (#12197)

A pseudo-class for this would work, since we are depending on characteristics of the content. We probably want min/max variants, so a possible syntax could be:

```
:aspect-ratio(<ratio>)
:min-aspect-ratio(<ratio>)
:max-aspect-ratio(<ratio>)
:portrait
:landscape
```

or

```
:aspect-ratio( [ [ min | max ]? && <ratio> ] | portrait | landscape)
```

So the two questions, if we want to add this, would be:
- What syntax do we want?
- Do we want it to reflect the aspect ratio described in the markup, or only the actual aspect ratio of the replaced content? (The former is probably more useful.)

-- 
GitHub Notification of comment by fantasai
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12197#issuecomment-3016215914 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Sunday, 29 June 2025 01:49:51 UTC