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

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

From: Emilio Cobos Álvarez via GitHub <sysbot+gh@w3.org>
Date: Wed, 24 Jan 2018 21:48:12 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-360284851-1516830490-sysbot+gh@w3.org>
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 https://github.com/w3c/csswg-drafts/issues/1968#issuecomment-360284851 using your GitHub account
Received on Wednesday, 24 January 2018 21:48:14 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:23 UTC