Re: [mediaqueries] calc() and other syntax restrictions (was: Re: Validating media queries in Java)

Hi,

I know this a very, very old topic but as I actually "stumbled upon" this exact
problem I would like to respond.
You wrote:
> No doubt somebody some day wants to write
>
>     @media screen and (min-width: calc(20em + 6px))

and

> But I agree. We can exclude calc().

I would like to contradict. ;-)
I also do not see the sense of the above code example, but it would be most
helpful if someone could write:

    @media screen and (min-width: calc(20em + 1px))

Using em based media queries has several advantages over using pixel based ones.
And also having your rules stacked instead of overlapping might be the better
option for some cases.

For this case it would be the only pure CSS based possibility to ensure that
there will be no gaps (in case of larger basic font size) or (unwanted) overlaps
(in case of smaller basic font size) in your ruleset.
Because as the EM based values depend on the users basic font size, there is no
EM 'value' that will always be computed as 1px!

I think it is worth to expand the calc() syntax to also being used with media
queries!

Regards

Gunther Pilz

Received on Thursday, 2 May 2013 17:19:23 UTC