Skip to content

Commit 716bd86

Browse files
devGregAclaude
andcommitted
docs: keep breadcrumbs on a single line
Bootstrap breadcrumbs prefix each crumb with its "/" separator, so when the trail wrapped the separator dangled at the start of the next line. Keep the trail on one line and ellipsize long crumbs instead: "Home" never shrinks, ancestors compress to readable stubs, and the current page keeps roughly twice the room. The active item renders as a block because text-overflow does not draw an ellipsis on a flex container. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent bf7b4d3 commit 716bd86

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

docs/assets/scss/common/_custom.scss

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -987,11 +987,41 @@ html:not([data-dd-version='pro']) .version-pro {
987987
}
988988
}
989989

990+
// Single-line breadcrumb: long crumbs ellipsize instead of wrapping, which
991+
// otherwise strands a leading "/" separator at the start of the next line.
990992
.breadcrumb {
991993
font-size: 0.8125rem;
992994
padding: 0;
993995
margin-top: 1.5rem;
994996
margin-bottom: 0.75rem;
997+
flex-wrap: nowrap;
998+
min-width: 0;
999+
}
1000+
1001+
.breadcrumb-item {
1002+
display: flex;
1003+
align-items: center;
1004+
min-width: 3rem; // every crumb keeps a readable stub + ellipsis
1005+
white-space: nowrap;
1006+
1007+
a {
1008+
overflow: hidden;
1009+
text-overflow: ellipsis;
1010+
}
1011+
1012+
&:first-child {
1013+
flex-shrink: 0; // "Home" is the shortest crumb; never truncate it
1014+
min-width: 0;
1015+
}
1016+
1017+
&.active {
1018+
// Block, not flex: text-overflow only renders on block containers, and
1019+
// the current page is bare text (no inner anchor to ellipsize).
1020+
display: block;
1021+
overflow: hidden;
1022+
text-overflow: ellipsis;
1023+
flex-shrink: 0.5; // current page keeps roughly twice the room of ancestors
1024+
}
9951025
}
9961026

9971027
.breadcrumb-item a {

0 commit comments

Comments
 (0)