Re: [csswg-drafts] why mediaqueries? (#8472)

> What do you think of this idea? (my idea would be to use arrays, nth-child for the media property) does it make sense or not? your opinion is important, in case this idea is bad. I'll put it aside.

The issue is that I'm not sure why you're wanting to do this. All that's been done so far is showing syntax examples; you haven't explained what this syntax is helping you do, and why you believe it's worthwhile. This is what I meant by my explanation of use-cases.

For example, if we were to try and justify adding the mathematical/range syntax to MQs today, the argument would be something like:

> * min-* and max-* can be confusing in practice; you use `min-*` to set up an MQ for things *larger* than a value, while `max-*` is for things *smaller* than a value. min-* makes more sense in things like min-width, where you're applying a *minimum* to a value, but it's easier to get confused when it's being used in a comparison sense like this. `width <= 500px` is much harder to misunderstand.
> * min-* and max-* are defined as being `>=` and `<=`, which makes it hard/impossible to accurately express consecutive ranges. `(width < 500px)` and `(width >= 500px)` correctly cover a range; exactly one of them matches any given length, and you never have both or neither matching.
> * writing an MQ for a finite range is pretty common, but pretty verbose to express - `(min-width: 500px) and (max-width: 1000px)`. `(500px <= width < 1000px)` is compact, easy to read, and well-known from languages like Python.

These explain why this particular syntax is good, and what they're fixing about the previous syntax. It's both fixing things that are fundamentally impossible in the old syntax (having consecutive ranges that work reliably), and making opinion-based improvements, with explanations for why those opinions are worth addressing.

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


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

Received on Monday, 27 February 2023 18:53:52 UTC