Cap container width values along with all other capped values to make result linear
theorosendorf opened this issue · 2 comments
From #25
Note: @theorosendorf said the relationship between line-height and width is linear (#21 (comment)), but in my testing it didn't appear linear. (A test div with
minWidth: 400
,maxWidth: 800
,minLineHeight: 1
, andmaxLineHeight: 2
yielded a line-height of 1.2 at 600px wide, instead of an expected 1.5. But my test might have been flawed. FWIW.)
Good catch @tinymachine
I found that, for instance even though we are capping the resulting min/maxWidthFontSize values, the calculation is still based on widths beyond the min/maxWidth. To test this, in the demo I set the font sizes to 10 and 20, constrained the container width to 400 and 800, and at 600, the size was 15.
Ah, gotcha -- so the script wasn't capping the container width, just the resulting attribute values. Based on this issue's title, it sounds like you want to switch to capping container widths, which is what I did with the calculations in the PR (b91df7b), in which case PR #25 should close this issue. (And once the container width is capped, the resulting values are necessarily capped as a result.)
Think so. At least that's the theory... :)