Skip to content

Commit fb302ef

Browse files
committed
css: keep schema-table identifiers from wrapping mid-word
Tables in the developer guides use the first column for identifiers (field names like 'display_manager', package names like 'gnome-control-center'). When the column was narrow, mkdocs material was wrapping the identifier between letters — 'display_manage' / 'r' — which was unreadable. Add a CSS rule that says: in any table, if the first column's cell contains a <code> element, don't wrap that code. The rule is scoped to <code> in the first cell so prose tables (where the first column might be a sentence) are unaffected. The result is that schema tables auto-size their first column to fit the longest identifier without wrapping mid-word, while keeping the rest of the columns flexible.
1 parent 5dfae63 commit fb302ef

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

docs/css/armbian-extra.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,17 @@
2323
display: table;
2424
}
2525

26+
/* Prevent the first column of schema/reference tables from wrapping
27+
* mid-identifier. Identifiers like 'display_manager' or 'gnome-control-center'
28+
* are common in the developer-guide tables and look terrible when broken
29+
* across lines (e.g. 'display_manage' / 'r').
30+
* Scope to <code> in the first cell so prose tables are unaffected.
31+
*/
32+
.md-typeset table:not([class]) td:first-child code,
33+
.md-typeset table:not([class]) th:first-child code {
34+
white-space: nowrap;
35+
}
36+
2637
/* Style for only specially tagged bash blocks */
2738
pre.custom-bash-block, code.custom-bash-block {
2839
font-size: 24pt;

0 commit comments

Comments
 (0)