Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mediaqueries-4] change infinite in resolution descriptor to infinity to match css-values #7939

Closed
romainmenke opened this issue Oct 21, 2022 · 4 comments

Comments

@romainmenke
Copy link
Member

romainmenke commented Oct 21, 2022

https://www.w3.org/TR/mediaqueries-4/#resolution

@media (min-resolution: infinite) {}

@media (resolution = infinite) {}

@media (infinite = resolution) {}

@media (resolution < infinite) {}

@media (infinite > resolution) {}

As far as I know this is currently the only current media description that has a range type while also accepting an <ident> value (infinite).

I am assuming that the syntactical ambiguity is ok because browsers would have lists of known media descriptors.

In css-values the numeric constant infinity is defined.
Should this same constant be used here?

infinite -> infinity

In a range context this seems more intuitive :

@media (resolution = infinity) {}

@media (infinity = resolution) {}

@media (resolution < infinity) {}

@media (infinity > resolution) {}

Maybe this is a moot point since infinity is a numerical constant so should be allowed anyway with calc.

@media (resolution = calc(infinity)) {}

@media (calc(infinity) = resolution) {}

@media (resolution < calc(infinity)) {}

@media (calc(infinity) > resolution) {}
@romainmenke
Copy link
Member Author

nvm, infinite aligns with the keyword used in transitions so also has a precedent.

@tabatkins
Copy link
Member

Yeah, we ended up with the property-specific keyword form being "infinite", but it felt weird to have infinite be a numeric keyword for calc().

@Loirooriol
Copy link
Contributor

Note that with calc you would need something like calc(infinity * 1dppx) in order to get a <resolution>, and this won't be the same as infinite as noted in https://drafts.csswg.org/css-values-4/#calc-range

Even properties that can explicitly represent infinity as a keyword value, such as animation-iteration-count, will end up clamping ±∞, as math functions can’t resolve to keyword values; the numeric part of the property’s syntax still has a minimum/maximum value.

@romainmenke
Copy link
Member Author

relevant : #8998

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants