diff --git a/docs/css_types/text_overflow.md b/docs/css_types/text_overflow.md deleted file mode 100644 index 495e1c2ba..000000000 --- a/docs/css_types/text_overflow.md +++ /dev/null @@ -1,35 +0,0 @@ -# <text-overflow> - -The `` CSS type sets how Textual wraps text. - -## Syntax - -The [``](./text_overflow.md) type can take any of the following values: - -| Value | Description | -| ---------- | ----------------------------------------------------------------------------------- | -| `clip` | Overflowing text will be clipped (the overflow portion is removed from the output). | -| `fold` | Overflowing text will fold on to the next line. | -| `ellipsis` | Overflowing text will be truncate and the last character replaced with an ellipsis. | - - -## Examples - -### CSS - -```css -#widget { - text-overflow: ellipsis; /* Disable wrapping */ -} -``` - -### Python - -```py -widget.styles.text_overflow = "ellipsis" # Disable wrapping -``` - - -## See also - - - [`text-wrap`](./text_wrap.md) to enable or disable text wrapping. diff --git a/docs/css_types/text_wrap.md b/docs/css_types/text_wrap.md deleted file mode 100644 index cb521ed96..000000000 --- a/docs/css_types/text_wrap.md +++ /dev/null @@ -1,33 +0,0 @@ -# <text-wrap> - -The `` CSS type sets how Textual wraps text. - -## Syntax - -The [``](./text_wrap.md) type can take any of the following values: - -| Value | Description | -| -------- | ------------------------- | -| `wrap` | Word wrap text (default). | -| `nowrap` | Disable text wrapping. | - -## Examples - -### CSS - -```css -#widget { - text-wrap: nowrap; /* Disable wrapping */ -} -``` - -### Python - -```py -widget.styles.text_wrap = "nowrap" # Disable wrapping -``` - - -## See also - - - [`text-overflow`](./overflow.md) is used to change what happens to overflowing text. diff --git a/docs/snippets/syntax_block_end.md b/docs/snippets/syntax_block_end.md index a100faef8..40edfcbfd 100644 --- a/docs/snippets/syntax_block_end.md +++ b/docs/snippets/syntax_block_end.md @@ -1,2 +1,2 @@ - + diff --git a/docs/snippets/syntax_block_start.md b/docs/snippets/syntax_block_start.md index 09c648ce9..5000971dd 100644 --- a/docs/snippets/syntax_block_start.md +++ b/docs/snippets/syntax_block_start.md @@ -1,3 +1,2 @@ -
-
+
diff --git a/docs/styles/text_overflow.md b/docs/styles/text_overflow.md index 772a19176..018a152a8 100644 --- a/docs/styles/text_overflow.md +++ b/docs/styles/text_overflow.md @@ -2,20 +2,29 @@ The `text-overflow` style defines what happens when text *overflows*. -Text overflow occurs when there is no space on the vertical axis to fit the entire text. +Text overflow occurs when there is not enough space to fit the text on a line. This may happen if wrapping is disabled (via [text-wrap](./text_wrap.md)) or if a single word is too large to fit within the width of its container. ## Syntax --8<-- "docs/snippets/syntax_block_start.md" -text-overflow: <overflow>; +text-overflow: clip | fold | ellipsis; --8<-- "docs/snippets/syntax_block_end.md" +### Values + +| Value | Description | +| ---------- | ---------------------------------------------------------------------------------------------------- | +| `clip` | Overflowing text will be clipped (the overflow portion is removed from the output). | +| `fold` | Overflowing text will fold on to the next line(s). | +| `ellipsis` | Overflowing text will be truncated and the last visible character will be replaced with an ellipsis. | + + ## Example In the following example we show the output of each of the values of `text_overflow`. -The widgets all have [text wrapping][`text-wrap`](./text_wrap.md) disabled, which will cause the +The widgets all have [text wrapping](./text_wrap.md) disabled, which will cause the example string to overflow as it is longer than the available width. In the first (top) widget, `text-overflow` is set to "clip" which clips any text that is overflowing, resulting in a single line. diff --git a/docs/styles/text_wrap.md b/docs/styles/text_wrap.md index 3a770ac92..0b0975e80 100644 --- a/docs/styles/text_wrap.md +++ b/docs/styles/text_wrap.md @@ -7,7 +7,7 @@ You can also set this style to "nowrap" which will disable wrapping entirely. ## Syntax --8<-- "docs/snippets/syntax_block_start.md" -text-wrap: <text-wrap>; +text-wrap: wrap | nowrap; --8<-- "docs/snippets/syntax_block_end.md" diff --git a/mkdocs-nav.yml b/mkdocs-nav.yml index 671c78151..3180d74ae 100644 --- a/mkdocs-nav.yml +++ b/mkdocs-nav.yml @@ -41,9 +41,7 @@ nav: - "css_types/percentage.md" - "css_types/scalar.md" - "css_types/text_align.md" - - "css_types/text_overflow.md" - "css_types/text_style.md" - - "css_types/text_wrap.md" - "css_types/vertical.md" - Events: - "events/index.md"