-
Notifications
You must be signed in to change notification settings - Fork 756
Description
Line grid has an problem, alluded to in the Leading adjustments section.
If mixed fonts are used either explicitly or through fallbacks and some of the fonts are larger that then default font on the element, or are no larger but have a different baseline position, lines will be double spaced, even if visually it looks like there is plenty of room. The same problem may occur when if <sub> or <sup> are used.
If there was an allowed margin of error by which things are allowed to stick out before causing the line box to be shifted down, we could avoid this problem, but it isn't clear what that margin should be. I think that combining line-height-step with the line grid may be a way to solve that.
Reusing the terminology I proposed in #940, the difference between the natural line box and the adjusted line box could be this margin of error.
Here are a handful of proposals about how this might work:
- "Independent but complementary"
- Define
line-grid:createto make a line grid based on the size of the line-box as adjusted byline-height-step([css-rhythm][css-line-grid] Work out the interaction between line-height-step and line-grid #939) - Change the definition of line-height-step so that when it is used with line-snap, the position of the baseline in the adjusted line box is set just right to avoid creating gaps ([css-rhythm][css-line-grid] Work out the interaction between line-height-step and line-snap #940)
-
The short-hand approach
Same as (1), plus make line-height-step a longhand of line-grid and redefine line-grid as
create <line-height-step>? | match-parent -
The auto approach
Same as (1), plus redefine line-grid to
create <length>? | match-parent
andline-height-steptoauto | <length>, withline-height-step:autogetting its value from the<length>param of line-grid. -
The "just the line grid" approach
redefine line-grid to
create <length>? | match-parent
and use the extra parameter to give some breathing room to the line box, without invoking step-sizing.
1, 2 and 3 are sort of the same, but they cascade differently (and 2&3 should be identical if the author doesn't specify the line-height-step property). It is not entirely obvious to me if the fact that (unlike line-grid) line-height-step is inherited was a useful thing or a footgun. It case it is not a useful thing, solution 4 deals with the line-grid problem without getting the potential footgun.
Yet an other alternative is to make line-height-step non inherited, in which case 2/3/4 become much more similar to eachother (i.e. identical if the author doesn't specify the line-height-step property).