[dojo-contributors] Text sizing using em

sam foster potatosculptor at gmail.com
Wed May 7 10:51:00 EDT 2008


We had a similar discussion on #dojo
I can see the sense in having a sanity-check kind of baseline so
whatever context the widgets are being show in, they look reasonable.
OTOH, I also feel that widgets need to fully participate in whatever
CSS cascade has been setup for that page - particularly wrt font-size.
If an author wants big text on the page, widget text (labels and
contents) should scale accordingly

The problem we're trying to address is font-size compounding. If
elements with proportional font-size (e.g. 0.9em) get nested, the text
gets smaller and smaller. 0.9 * 0.9 != 0.9
The best practice I believe is to move font-size properties to leaf
nodes wherever possible. At times though nesting is unavoidable, and
we need a way to pin or reset the font-size to avoid this compounding.
font-size: 100% might do it, it would need testing

E.g.
.labelText {
  font-size: 0.9em;
}
.labelText .labelText {
  font-size: 100%;
}

<div class="labelText">Some label<div class="somethingElse"><span
class="labelText">nested label</span></div>

Sam



More information about the dojo-contributors mailing list