Skip to content

Can you cut off the displayed text in TOC if it goes beyond the available with? #6128

Answered by Andre601
Andre601 asked this question in Q&A
Discussion options

You must be logged in to vote

FINALLY got it to work...
The problem was, that the nav is set to a flex, so I had to change the display to a block for the .md-nav__link part, which resulted in this CSS snippet to use:

.md-nav--secondary li.md-nav__item > .md-nav__link {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

This now properly cuts the text and suffixes it with a ....
I kinda wanted to use fade tho, but apparently is it no longer a thing despite what the Mdn docs say.

Either way, it works now and I'm happy.

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@Andre601
Comment options

@Andre601
Comment options

@Andre601
Comment options

@Andre601
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by Andre601
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants