- From: Tab Atkins Jr. <jackalmage@gmail.com>
- Date: Fri, 31 Aug 2012 10:12:26 -0700
- To: "Marat Tanalin | tanalin.com" <mtanalin@yandex.ru>
- Cc: François REMY <fremycompany_pub@yahoo.fr>, CSS WG <www-style@w3.org>
On Fri, Aug 31, 2012 at 6:43 AM, Marat Tanalin | tanalin.com <mtanalin@yandex.ru> wrote: > 31.08.2012, 17:35, "François REMY" <fremycompany_pub@yahoo.fr>: >> | Actually, you can just specify base font-size for `HTML` element instead >> of `BODY` element. >> >> Certainly not. If you do that, you can't know any more if the user is vision >> impaired and volountarily INCREASED the root font size in its settings. > > If your goal is to link `rem` and user's default font-size, wouldn't specifying base font-size in `em` for `HTML` element sufficient? > > HTML {font-size: .8125em; } > /* If default font-size is 16px, `rem` is now 13 pixels */ Yup, this'll work. If you want to just repurpose rem as a "responsive pixel", just use this: html { font-size: .0625em; } /* set the rem to one "responsive pixel" - on most machines, this'll equal 1px */ body { font-size: 16rem; } /* Set the base font size back to the user's default. */ This does make it slightly harder to use rem for its originally intended purpose, but you can just use 16rem anywhere you would normally use 1rem for the same effect. ~TJ
Received on Friday, 31 August 2012 17:13:13 UTC