Skip to content

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.

OperandFrom
self.textOverflowdocument
self.maxLinesdocument

Cases

Ordered — first match wins.

#WhenEmitsWhy
1self.maxLines present and self.maxLines ≠ 1display: -webkit-box
-webkit-box-orient: vertical
-webkit-line-clamp: <self.maxLines>
line-clamp: <self.maxLines>
overflow: hidden
multi-line clamp changes the display type
2self.maxLines = 1 and self.textOverflow = ELLIPSISwhite-space: nowrap
overflow: hidden
text-overflow: ellipsis
3self.maxLines = 1white-space: nowrap
overflow: hidden
4self.textOverflow = ELLIPSISoverflow: hidden
text-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.