Re: [css3-mediaqueries] Media query "em" example contradicts normative prose

On Wed, 22 Feb 2012 14:45:50 +0100, Boris Zbarsky <bzbarsky@mit.edu> wrote:

> On 2/22/12 5:21 AM, Florian Rivoal wrote:
>> Right. It can be done, but it would need disclaimers. Since it doesn't
>> bring much new information, as the same principle applies to em and rem,
>> I'd rather leave it out. But that's not a very strong preference, so if
>> a large number of people want it in, I can certainly add it.
>
> Maybe I should give some background.  I've seen at least one bug report  
> so far against Gecko (and a similar one claimed to be filed against  
> Opera) because of the fact that in this one instance "rem" refers to the  
> default size, not the root element size.  It's not something web authors  
> expect, and I think calling it out in an example would prevent a good  
> bit of frustration in the future....

The part between *** has been added to the spec to try to clarify the
situation and avoid the potential confusion you noted:

   Relative units in media queries are based on the initial
   value, *** which means that units are never based on
   results of declarations***. For example, in HTML, the
   ‘em’ unit is relative to the initial value of ‘font-size’.

We do not mention the rem unit directly, to avoid creating dependencies
to other specs, but the wording should be explicit enough to make the
behavior of all units, rem included, clear.

Please let me know if this addresses your concern.

  - Florian

Received on Friday, 23 March 2012 12:29:19 UTC