textTruncation
disposition: bound, basis: implementation
A rule of the CSS binding. These keys resolve jointly — no one of them determines any single output, so the rule below is the mapping.
Keys. textOverflow, maxLines
Operands
Every fact the rule reads. Nothing outside this set participates.
| Operand | From |
|---|---|
self.textOverflow | document |
self.maxLines | document |
Cases
Ordered — first match wins.
| # | When | Emits | Why |
|---|---|---|---|
| 1 | self.maxLines present and self.maxLines ≠ 1 | display: -webkit-box-webkit-box-orient: vertical-webkit-line-clamp: <self.maxLines>line-clamp: <self.maxLines>overflow: hidden | multi-line clamp changes the display type |
| 2 | self.maxLines = 1 and self.textOverflow = ELLIPSIS | white-space: nowrapoverflow: hiddentext-overflow: ellipsis | |
| 3 | self.maxLines = 1 | white-space: nowrapoverflow: hidden | |
| 4 | self.textOverflow = ELLIPSIS | overflow: hiddentext-overflow: ellipsis |
Otherwise
Nothing is emitted.
css/style/truncation.ts:12-37. The multi-line case sets display, so it interacts with the autoLayout rule on the same element.