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

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

From: Alan Stearns <stearns@adobe.com>
Date: Sat, 25 Jan 2014 22:43:26 +0000
To: Håkon Wium Lie <howcome@opera.com>
CC: "robert@ocallahan.org" <robert@ocallahan.org>, "www-style@w3.org" <www-style@w3.org>
Message-ID: <CF097A54.1799B%stearns@adobe.com>
On 1/25/14, 2:21 PM, "Håkon Wium Lie" <howcome@opera.com> wrote:
>  - 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.

> > Consider a layout where you have two floated boxes of text. You want
> > baselines in both floats to align to each other. I would like to be
> > to say that the first baseline and line-height in the first float
> > establishes a baseline grid that the content in both floats will align
> > And I want that first baseline in that first float to be positioned
> > normally - having it align to the float’s parent grid or the body grid
> > could move the line down farther from the top of the float than I want.
>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.

>If they are not next to each other, I'm not sure it matters much that
>their baselines are not aligned. By making the second float align to
>the baseline established by the first float you risk moving lines
>further down that you want to in the second float. So, I don't think
>introducing <ident> really solves the problem -- aligning to a common
>parent or root seem to have the same benefits.

This might be the case - and this argument is much better than saying you
can resort to picking the same line-height. I’m not entirely convinced
that parent and root are enough. In the case with particular line heights
above, I think you would get a better result by allowing one float to set
the grid for another, instead of relying on a parent or root grid at some
unknown relation to the float tops.



Received on Saturday, 25 January 2014 22:43:57 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:14:36 UTC