W3C home > Mailing lists > Public > www-style@w3.org > January 2014

Re: [css-gcpm][css-figures] float-offset & line rhythms

From: Håkon Wium Lie <howcome@opera.com>
Date: Sun, 26 Jan 2014 00:35:13 +0100
Message-ID: <21220.18993.833902.56118@gargle.gargle.HOWL>
To: Alan Stearns <stearns@adobe.com>
Cc: "robert\@ocallahan.org" <robert@ocallahan.org>, "www-style\@w3.org" <www-style@w3.org>
Also sprach Alan Stearns:

 > >  - one can easily set the same rhythm by setting the same font &
 > >    line-height properties. This would cover most use cases, I think.
 > 
 > If that were true, then there would be no need for baseline grids. It’s
 > only the cases this technique does not cover that require a shared
 > baseline grid.

Maybe we talk past each other. 

My main use case for baseline rhythms is to align the content between
columns. The columns are typically in the same element, so one only
needs to set the baseline rhythm once. Like in:

  article { font: 12pt/1.2 serif; line-rhythm: new; columns: 12em }

This will ensure that body text picks up the rhythm after figures,
sub-headings and other pesky intrusions.

The same will happen if you set the rhythm on several elements:

  article, aside { font: 12pt/1.2 serif; line-rhythm: new }
 
That is, body text in these elements will pick up the rhythm after
figures (which is what I'm after, primarily). They will not
necessarily use the same set of baselines (which I think you're
after), but the frequency of the rhythm is the same.

I also want to be able to use the exact same baselines, but I believe
that setting the baseline rhythm on the root, or another common
ancestor, is sufficient to achieve this.

 > >If the two floats are next to each other along the baseline axis, you
 > >should be able to establish the same baseline rhythm for the two of
 > >them by setting the same font/line-height etc.
 > 
 > The simplest case where this does not work is where both floats have a
 > subhead with a slightly larger line-height than the regular paragraphs,
 > and the subheads end up with a different number of line breaks. Let’s say
 > the paragraphs’ line-height is 20px, and the subhead’s line-height is
 > 24px. The first float has a single-line subhead, so the bottom of the line
 > boxes end up at 24px, 44px, 64px, etc. The second float’s subhead breaks
 > into two lines, so the bottom of the line boxes end up at 24px, 48px, 70px.

That's not how it works in my head. Assuming this code:

  #float1, #float2 {
    font: 20px/1 sans-serif;
    line-rhythm: new;
  }
  h2 { line-height: 24px; line-rhythm: none }

both floats will establish the same baseline rhythm with a frequency
of 20px. The existence of a subhead (H2) with one or two number of
lines inside the float will not change the rhythm. So the bottom of
the line boxes will be 20px, 40px, 60px etc in both elements.

I'm open for suggestions on how to better describe this in prose, in
case it's unclear in the spec.

Cheers,

-h&kon
              Håkon Wium Lie                          CTO °þe®ª
howcome@opera.com                  http://people.opera.com/howcome
Received on Saturday, 25 January 2014 23:36:01 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:39 UTC