Re: [csswg-drafts] [mediaqueries] How do media queries with calc() where it can be resolved early serialize?

Now I look at it, FF still doesn't ship this (it'll be on FF59), but will soon (it's the next release).

> Yeah, the resolution ended up what in what I think is the best situation - simplify/clamp as early as possible. In MQs, that's always possible, since the allowed relative units can be absolutized immediately.

I'm not sure we should convert relative units to absolute units (even though it's doable, and in fact trivial).

That'd be inconsistent with how every browser serializes something like:

@media (min-width: 10em) {}

(which preserves the unit).

In any case, the following:

@media (min-width: calc(1em + 10px)) {}

Should serialize either as `calc(1em + 10px)` or as `26px`, IMO. @csnardi what does WebKit do there?

Firefox right now preserves the specified value as-is, which is kind of inconsistent with what we do for numbers, because `calc(10px)` serializes as `calc(10px)`, not as `10px`, unlike `calc(1)`, which serializes to `1`.

That's an artifact of how it was implemented and I'm happy to make whatever change the WG decides is sane :)

GitHub Notification of comment by emilio
Please view or discuss this issue at using your GitHub account

Received on Wednesday, 24 January 2018 21:48:14 UTC