-
Notifications
You must be signed in to change notification settings - Fork 320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use ellipsis to truncate breadcrumbs #1583
Conversation
447577a
to
c35d16e
Compare
ok, the feature works now on https://pydata-sphinx-theme--1583.org.readthedocs.build/en/1583/community/setup.html (personally I needed to zoom in a lot or turn on the browser dev tools pane to get the window narrow enough to see the effect; on smaller screens that shouldn't be necessary). However, I had to remove |
This is fantastic, @drammock - thank you! My trick for checking is to inspect the breadcrumb node in questions and then paste its own content multiple times in there. I'm setting this up locally right now to play with it, specifically I'm going to try to apply the logic to the |
In my tests this didn't work, but maybe you'll have better luck (I think there was a SO post that explained why it wouldn't work but I'm on mobile and can't easily find it right now) EDIT: https://css-tricks.com/flexbox-truncated-text/ (though cf https://codepen.io/psyrendust/pen/ZWPxmM/) |
It is working as expected on my side could you describe what is preventing you from making this PR ready to merge ? |
I haven't thoroughly tested that things don't look weird under circumstances that don't occur in our own docs / tests. Specifically (as I mentioned above) I'm worried about user sites that put multiple items into |
@@ -5,14 +5,25 @@ ul.bd-breadcrumbs { | |||
list-style: none; | |||
padding-left: 0; | |||
display: flex; | |||
flex-wrap: wrap; | |||
flex-wrap: nowrap; | |||
|
|||
// Font size slightly smaller to avoid cluttering up space too much | |||
font-size: 0.8rem; | |||
|
|||
li.breadcrumb-item { | |||
display: flex; | |||
align-items: center; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
align-items was changed to center and was this conflicting, I resolved the conficlt.
(this might get closed by #1861 anyway, but it was easy to fix conflict) |
This PR: - Fixes breadcrumb truncation to use CSS `overflow: ellipsis` - Provides an example for combining playwright and sphinx_build_factory to more thoroughly test our theme components. - Applies that approach to testing breadcrumb truncation via ellipsis when the breadcrumb is placed in various parts of our layout. joint work with @munkm and @drammock closes #1583 closes #1568 lays groundwork for addressing #229 --------- Co-authored-by: Daniel McCloy <[email protected]> Co-authored-by: Madicken Munk <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: gabalafou <[email protected]>
WIP to address #1568.
Doesn't work. The below proof-of-concept with the same tag structure / depth of nesting does work, so I'm a bit at a loss as to where the crucial difference is.If anyone finds it helpful, the below HTML reconstructs the basic node structure of our theme. As written it doesn't work, but seems to work fine as long as you remove
display: flex
from any one of the outer flex nodes (anything parent to theul
node).