You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A cell with fit: true would not cause auto tracks it is in to expand. For example, it could request more height for an auto row, but it wouldn't be given that height.
Importantly, this changes layout() inside that cell to return the final height of the auto row instead of +inf, for example (i.e. 100% would correspond to the final height of the auto row for height, and final width of the auto column for width).
Ideally we'd allow configuring this per axis. For example, fit: (true, false) would make sure an auto column would ignore the cell's width, but the auto row would consider its height.
Use Case
This would appeal to the common use case of having content with the same height or width as some other content. For example, you'd write
and you'd get a red block with the same height as the lorem(400) next to it, regardless of how much height it has, thus not requiring a call to measure.
This is, however, mostly a (positive and useful) side effect of the more general purpose of this feature, which is to provide more fine-grained control over how cells affect track sizes in the table / grid.
The text was updated successfully, but these errors were encountered:
Agree. Or maybe it can be inverted and called clip to match other functions? I suppose the semantics wouldn't be exactly the same but the spirit would be.
My main concern with expand is that the terminology is confusing with the internal terminology. IIUC expand: true in Typst would lead to expand: false in the regions.
Internally, expand means: Fit exactly this space
Here, expand would mean: You can grow on your own, independent of peer cells
So maybe grow or growable or something else would be better. Not sure.
Description
Related: #3001
A cell with
fit: true
would not cause auto tracks it is in to expand. For example, it could request more height for an auto row, but it wouldn't be given that height.Importantly, this changes
layout()
inside that cell to return the final height of the auto row instead of +inf, for example (i.e.100%
would correspond to the final height of the auto row for height, and final width of the auto column for width).Ideally we'd allow configuring this per axis. For example,
fit: (true, false)
would make sure an auto column would ignore the cell's width, but the auto row would consider its height.Use Case
This would appeal to the common use case of having content with the same height or width as some other content. For example, you'd write
and you'd get a red block with the same height as the
lorem(400)
next to it, regardless of how much height it has, thus not requiring a call tomeasure
.This is, however, mostly a (positive and useful) side effect of the more general purpose of this feature, which is to provide more fine-grained control over how cells affect track sizes in the table / grid.
The text was updated successfully, but these errors were encountered: