You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Long labels in the sidebar do not display correctly #10531
I already raised a question about this topic in a previous discussion, but now it affects me again, in a site that includes TypeScript Reference pages:
I know that table cells can be configured to cut long texts and show ellipses (with your help I fixed the custom tables in my pages), but sidebars are a bit more complicated and I could not fix them with local CSS patches.
Can we so something to make the sidebar look better? With the current layout I doubt we'll win any beauty contest... :-(
I choose line-clamp: 2 over the methods above since it's widely supported CSS now (under -webkit prefix though), and looks like a reasonable default to show 2 lines for most sites. But you can easily override that value.
We can clamp properly both docs/links and expandable category items (with/without generated index). Hover shows a tooltip thanks to title (not perfect for accessibility, but good enough).
Activity
PranavKeshav24 commentedon Oct 1, 2024
slorber commentedon Oct 3, 2024
@PranavKeshav24 you can already start working on it. We only assign an issue after you open a draft PR showing you are capable of solving the problem.
slorber commentedon Oct 3, 2024
cc @pwizla I remember seeing Strapi docs also truncating sidebar labels, maybe that could serve as an inspiration for the CSS to use to solve this
https://docs.strapi.io/dev-docs/api/document-service
pwizla commentedon Oct 3, 2024
Thank you for the heads-up, @slorber! This comment is timely as I'm completely reworking the style of Strapi docs. 😄
@PranavKeshav24 Here's what did the trick for us, if you simply want to truncate the content: https://github.com/strapi/documentation/blob/main/docusaurus/src/scss/sidebar.scss#L139-L140 (and you might not even need the
white-spaceproperty, we have it because we sometimes add labels to the sidebar items).Sanjoy-droid commentedon Oct 4, 2024
@shipswake could you be more specific on how to reproduce the issue? I was not able to reproduce the bug
shipswake commentedon Oct 4, 2024
From above:

If you have a very long label in the sidebar the label will be hidden behind the page
The label should be truncated with an ellipsis and the full label readable in a tooltip when hovering over the label.
Here is the discussion:
#10529
PranavKeshav24 commentedon Oct 7, 2024
Thank you so much for sharing that. 😄
Shrasingh commentedon Oct 11, 2024
PrinceACS commentedon Oct 12, 2024
omchaudhary007 commentedon Oct 13, 2024
omchaudhary007 commentedon Oct 13, 2024
YoosufAathil commentedon Oct 14, 2024
krVatsal commentedon Oct 14, 2024
shipswake commentedon Oct 29, 2024
Any update on this?
Josh-Cena commentedon Oct 29, 2024
Any update is visible in this thread. No PR means no progress.
vipulbhasin23 commentedon Jul 17, 2025
Typically, the way this is done is by making the anchor tag a block element (display: block) and then apply the CSS properties to show ellipsis when the text overflows https://developer.mozilla.org/en-US/docs/Web/CSS/text-overflow
The CSS properties to be set are: white-space(nowrap), overflow(hidden), and text-overflow(ellipsis): which is what @pwizla has pointed out above.👍
ilg-ul commentedon Jul 21, 2025
Any progress on this?
I already raised a question about this topic in a previous discussion, but now it affects me again, in a site that includes TypeScript Reference pages:
I know that table cells can be configured to cut long texts and show ellipses (with your help I fixed the custom tables in my pages), but sidebars are a bit more complicated and I could not fix them with local CSS patches.
Can we so something to make the sidebar look better? With the current layout I doubt we'll win any beauty contest... :-(
ilg-ul commentedon Jul 22, 2025
@slorber, any idea how to patch the CSSs for the sidebar to cut long labels and show ellipses?
ilg-ul commentedon Jul 29, 2025
For the records, in case someone else will encounter this problem.
I fixed it by adding
className: doxyEllipsisto the sidebar entries that require ellipsisAn example how this looks is the Classes -> Hierarchy entry in the µTest++ website:
slorber commentedon Jul 31, 2025
Going to be fixed in #11356
I choose
line-clamp: 2over the methods above since it's widely supported CSS now (under-webkitprefix though), and looks like a reasonable default to show 2 lines for most sites. But you can easily override that value.We can clamp properly both docs/links and expandable category items (with/without generated index). Hover shows a tooltip thanks to
title(not perfect for accessibility, but good enough).ilg-ul commentedon Aug 2, 2025
It looks definitely better, thank you!