Getting started
Resources
Flex
Spacing
Layout
Size
Typography
Background
Border
Transition
Utility classes for changing an element's white space and text overflow properties. The white space property defines how consecutive white space and text wrap is handled for labels. Overflow affects how the label behaves when the content is too big for the container's dimensions.
Classes for white space are named using the format: [text]-[value]
.
Where value includes:
wrap
- for white-space: normal
nowrap
- for white-space: nowrap
pre
- for white-space: pre
prewrap
- for white-space: pre-wrap
Classes for text overflow are named using the format: [text]-[value]
.
Where horizontal includes:
clip
- for text-overflow: clip
ellipsis
- for text-overflow: ellipsis
Class | Contents |
|
|
|
|
|
|
|
|
|
|
|
|
Note that white-space: nowrap
and text-overflow: clip
are the default values for white space and text overflow in Unity. Unless the value needs to be overridden from a parent, thetext-nowrap
and text-clip
classes are not needed.
pre will only wrap on linebreaks
newline
UXML
Text overflow classes will not work if the container does not have a defined size with width/height and overflow: hidden set.
clip will cut off the text when it reaches the parent's bounds
ellipsis will change overflowing text to '...' when it reaches the parent's bounds
UXML
On this page