about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJubilee <46493976+workingjubilee@users.noreply.github.com>2024-07-21 17:44:29 -0700
committerGitHub <noreply@github.com>2024-07-21 17:44:29 -0700
commitb9c9f07db0705b9686a0b8a0aec03c887577211a (patch)
tree3ead5fe3072dbe005e78bed280d5883183550b4a
parent2ef7699a1a64fb1141605d18b90470e8649784d7 (diff)
parent95335444f7171c4582fd56f20ade6f84da84c984 (diff)
Rollup merge of #128023 - Kijewski:pr-table-width, r=notriddle
rustdoc: short descriptions cause word-breaks in tables

The `.item-table` class is used to display name+description lists, e.g. the exported functions, as a table. If the names are long and the descriptions are short, then the width of the table does not expand to the whole size, but only uses a fraction. This causes a some names to break inside a word.

This change makes the table always use 100% of its parent width. The `.width-limiter` wrapper already ensures that the used width still does not become excessive.

See e.g. <https://docs.rs/mathlab/0.3.0/mathlab/fun/vec_num/index.html> or <https://docs.rs/cw-events/0.0.9/cw_events/> (random choices out of the list of the recent releases).

[![](https://i.imgur.com/XnH4eeT.png)](https://imgur.com/XnH4eeT) [![](https://i.imgur.com/7iQ9xE2.png)](https://imgur.com/7iQ9xE2)

The problem occurs (at least) in Firefox 130, Falkon 24, and Konqueror 22. It does not occur in Chrome 126.
-rw-r--r--src/librustdoc/html/static/css/rustdoc.css1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css
index caa9bd563b1..4445c0e9575 100644
--- a/src/librustdoc/html/static/css/rustdoc.css
+++ b/src/librustdoc/html/static/css/rustdoc.css
@@ -957,6 +957,7 @@ table,
 	display: table;
 	padding: 0;
 	margin: 0;
+	width: 100%;
 }
 .item-table > li {
 	display: table-row;