[csswg-drafts] [media-queries][css-sizing] Support <number> (and therefore calc) as a <ratio> (#3757)

AmeliaBR has just created a new issue for https://github.com/w3c/csswg-drafts:

== [media-queries][css-sizing] Support <number> (and therefore calc) as a <ratio> ==
The new [`aspect-ratio` property in css-sizing-4](https://drafts.csswg.org/css-sizing-4/#aspect-ratio) re-uses [the `<ratio>` data type defined for the aspect-ratio media query](https://drafts.csswg.org/mediaqueries-4/#aspect-ratio), which currently only excepts rational fractions defined as `<integer> / <integer>`.

For flexibility, I propose extending the `<ratio>` type to support:

- a single `<number>` value (so that you could specify `aspect-ratio: 1.5` instead of `aspect-ratio: 3/2`)

- maybe, an arbitrary numerical fraction (`aspect-ratio: 3.3/2.2`)

- maybe, a fraction of lengths (`aspect-ratio: 1ch/1em`)

The "maybes" are because — for the property, if not the media query — they could be replaced with `calc()` functions if (a) a single number value (the result of the math expression) is accepted as a ratio, and (b) for length fractions, [calc division of values with units](https://drafts.csswg.org/css-values/#calc-type-checking) is actually implemented.


Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3757 using your GitHub account

Received on Monday, 25 March 2019 04:18:04 UTC