W3C home > Mailing lists > Public > public-css-archive@w3.org > June 2018

Re: [csswg-drafts] [css-grid][css-sizing] Aspect Ratio

From: Tobi Reif via GitHub <sysbot+gh@w3.org>
Date: Sun, 24 Jun 2018 09:59:59 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-399744362-1529834398-sysbot+gh@w3.org>
Having an element width "ew" unit would be so useful ... I already use it via EQCSS. An example from one of my projects:

```
@element .page {
  img[src$=".svg"] {
    width: 30ew;
  }
}
```

The nice thing is that if .page has a max-width, the effective ew value will stop growing after that max width. With vw the effective value would continue to grow with the viewport.

And it could be a nice way of specifying aspect ratios (as @ewanm89 wrote earlier), eg `height: 100ew` in order to get a 1:1 ratio / a square.

-- 
GitHub Notification of comment by tobireif
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/333#issuecomment-399744362 using your GitHub account
Received on Sunday, 24 June 2018 10:00:05 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 9 October 2019 08:16:44 UTC