maxLines
The most lines the text may occupy before it is truncated, usually declared with textOverflow.
Path
…elements.<element>.styles.maxLines
Elements Supported
Value
TokenReference
A design token, written as a $token path plus a $type, as in { $token: Color/On surface, $type: color }. The consuming platform resolves it to a value.
number
null (default)
Themes
A TokenReference written here resolves under the theme in force on this element — the one it selects in themes, or the nearest ancestor’s. The same token path yields a different value under a different theme.
Platform bindings
Figma
Disposition: bound · Realised by: node.maxLines
Deferred to last — honoured only while textTruncation is ENDING, so textOverflow must land first.
CSS
Disposition: bound · Realised by: rule textTruncation
Resolved jointly with
This key does not map on its own. Its rule’s ordered case table is linked above.
textTruncation — CSS
Decisions
- ADR-062 — Text overflow style keys (
textOverflow,maxLines) - ADR-113 — Style defaults belong to the schema
Rules
| Rule | Statement |
|---|---|
| DSPEC-44 | Every property of Styles declares a default, and its value validates against that property’s own schema |
| DSPEC-45 | A declared default is a literal, never a TokenReference, PropBinding or Conditional |
| DSPEC-47 | Jointly resolved keys are stated as an ordered case table over a declared operand set, not as prose |
Source
| Format | File |
|---|---|
| JSON Schema | packages/schema/schema/styles.schema.json |
| TypeScript | packages/schema/types/Styles.ts |
| Specification | §4.1a, §11 |