- From: Brad Kemper <brad.kemper@gmail.com>
- Date: Mon, 6 Feb 2012 07:42:04 -0800
- To: Tab Atkins Jr. <jackalmage@gmail.com>
- Cc: Brian Manthos <brianman@microsoft.com>, Sylvain Galineau <sylvaing@microsoft.com>, "L. David Baron" <dbaron@dbaron.org>, www-style list <www-style@w3.org>, fantasai <fantasai@inkedblade.net>
On Feb 2, 2012, at 2:23 AM, Tab Atkins Jr. wrote: > On Wed, Feb 1, 2012 at 10:53 PM, Brad Kemper <brad.kemper@gmail.com> wrote: >> Actually, come to think of it, even this would be useful for some layout work when lots of things in a chain of descendants are measured in ems, and it is hard to track what the current font-size would be in pixels, but you know you want a certain distance that changes with the font-size (for a text-shadow offset, perhaps): >> >> calc(3px, as em) > > I don't understand how this would accomplish what you want. Assume > that the font-size was originally 15px, so this resolves to .2em. Then > the element changes to font-size:30px. This then resolves to .1em, > *not* to 6px like I think you want. If you were counting on this to > work with inheritance, ems are never inherited - they get computed > into px (this is why line-height can be specified with a <number> as > well). The idea is that if I wrote 'calc(3px, as em)', and the font-size was 10px, that it would be the same as if I had written 0.3em. If the UA's user interface then allows the user to change that '10px' into '20px', then the length would still be 0.3em, even though the UA had transformed the font sizes. In other words, 'calc(3px, as em)' would be short for 'calc(3px, as em, prior to any scaling of font sizes by the user)'.
Received on Monday, 6 February 2012 15:42:36 UTC