On Friday 2017-03-31 12:11 +0800, Tommy Kuo wrote:
> **Summary**
> 
> I am intent to implement the property `line-height-step`. And it would be 
> disabled behind the pref `layout.css.line-height-step.enabled` by default. It 
> is a property to make authors create the content with vertical rhythm easier.
> 
> **Link to standard**
> 
> CSS Rhythmic Sizing
> <https://drafts.csswg.org/css-rhythm/>

So in the discussions in the working group, I've been somewhat
skeptical that this feature does a good job of addressing the design
use cases that it's intended to address.

I think there are two issues with it:

First, in many cases, the goal of setting up vertical rhythm is to
ensure that different (adjacent) pieces of text have the same
rhythm, where by different pieces of text I mean things like text on
opposite pages, text in different columns, text in a float and in
the normal flow, or similar things.  'line-height-step' only
addresses this use case if the developer is *extremely* disciplined
to ensure that nothing other than line-height (e.g., border,
padding, margin) causes vertical spacing.  My sense was that the
line grid proposals were significantly better at addressing this use
case (since they established an overall grid), although they were
harder to implement (because they complicate things like sliding an
element's position in the block axis).

Second, I think the rhythm that line-height-step sets up probably
isn't the most desirable one.  I'd expect that it is preferable to
have the baseline of each line match the rhythm, but
line-height-step does not ensure this.  For example, if most lines
have a line box height that matches the step, but there is something
tall on a line (say, an image protruding upwards) that makes its
line box height initially (without the adjustment from the step) 2.1
times the step height, then the line with the tall thing on it gets
an additional 0.45 multiple of the step height on each side, which
means the baseline of the text is 0.45 times the step height above
the rhythm, so instead of having an appearance of skipping two lines
and then having a baseline at the correct position, you get
(ignoring the thing that protrudes above) the appearance of skipping
1.55 lines, having a misaligned baseline (0.45 above the rhythm
poisition), and then skipping the remaining 0.45.  I'd have thought
it would be preferable to put all the extra space above in this case
in order to keep the baseline matching the rhythm.  (In some cases
this would require an additional multiple of the step height.)  I
might be wrong about this, though; it's worth consulting designers
about what behavior is actually desirable.

-David

-- 
π„ž   L. David Baron                         http://dbaron.org/   𝄂
𝄒   Mozilla                          https://www.mozilla.org/   𝄂
             Before I built a wall I'd ask to know
             What I was walling in or walling out,
             And to whom I was like to give offense.
               - Robert Frost, Mending Wall (1914)

Attachment: signature.asc
Description: PGP signature

_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to