-
Notifications
You must be signed in to change notification settings - Fork 13k
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
rustdoc: staggered layout for module contents on mobile #85651
Conversation
Some changes occurred in HTML/CSS/JS. |
This comment has been minimized.
This comment has been minimized.
Note that the item names (e.g. |
Also, we might need a little vertical margin between items to visually separate them. I can't tell from the screenshots because they only include sections that have a single item each. |
Thanks for the hint! Currently it looks exactly the same (except for 1px more vertical space between the table item and the description and the serif links you mentioned) as the table variant, I added a bit of vertical space already. My plan is to rebase on master next week and demo with a bigger crate than genneric_array, which I choose because it uses almost all rustdoc features. Another question: currently the element names |
PS: I am also playing with the thought of merging #85540 into this PR, or will that one be merged soon anyways? |
I hope it will. :) |
I uploaded an interactive example: https://data.estada.ch/rustdoc-nightly_2023cc3aa1_2021-05-30/rustdoc_demo/ DesktopMobile |
This comment has been minimized.
This comment has been minimized.
@@ -1756,7 +1786,8 @@ details.undocumented[open] > summary::before { | |||
.search-results .result-name, .search-results div.desc, .search-results .result-description { | |||
width: 100%; | |||
} | |||
.search-results div.desc, .search-results .result-description { | |||
/* Display second row of staggered layouts */ | |||
.search-results div.desc, .search-results .result-description, item-right { |
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.
I was thinking about the "ideal" spacing some more. For the staggered layout in search, I suggested 2em
out of the blue. It would be nice for consistency to use a spacing that we use elsewhere. For instance, for docblocks we indent them 24px relative to their heading:
.docblock {
margin-left: 24px;
position: relative;
}
That works out to about 1.5em at our font sizes. So I think we should change padding-left: 2em
to margin-left: 24px
with a comment that we are matching it to the docblock indent.
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.
Bump on this comment
When I access your demo, I get this message in the Firefox console:
It probably doesn't make a difference for this particular PR but you might want to exempt your demo paths from that CSP rule, since it could make a difference in rendering. |
Other than my comment about |
This comment has been minimized.
This comment has been minimized.
I tried to fix one of the tests, but it looks like the feature |
Why do you need |
I need it because with grid-layout the structure changes from |
Is your intent for item-table / item-left / item-right to be used elsewhere
in the markup, or just for the listing of items in the module?
If the former, I'd give this item-table a class "module-items" and change
the XPath selector to //item-table[class=module-items]/item-right.
If the latter I'd do the same selector but without the class.
|
☔ The latest upstream changes (presumably #84703) made this pull request unmergeable. Please resolve the merge conflicts. |
dd2a42f
to
af3f964
Compare
This comment has been minimized.
This comment has been minimized.
I did plan to use it as a more generic way for all the static tables. So for now, I am going with the item path without the class. |
PS: I am using the grid layout because it automatically compacts the first column which would require active JavaScript with flexbox |
This comment has been minimized.
This comment has been minimized.
I fixed all the tests but there is a gap that is untestable:
There appears to be an alternative: lxml Apart from that, I think this PR is pretty much ready please review the demo here because optically it is pretty much the same as before: |
This comment has been minimized.
This comment has been minimized.
⌛ Testing commit b5610fbdae367f395899a40a4e92fd84e4d2d34c with merge eab335e32ed4fc5fa3a5df653fc439d040bcc568... |
This comment has been minimized.
This comment has been minimized.
The CI really doesn't want this PR (or is very broken). Any info about this @pietroalbini ? |
* implement sans-serif rust-lang#85621
…sibling::item-right` relationship and rustdoc-gui
b5610fb
to
94c84bd
Compare
I rebased the PR on master again, hope this helps |
Waiting for CI to confirm then approving again. |
@bors: r+ |
📌 Commit 94c84bd has been approved by |
☀️ Test successful - checks-actions |
It merged 🥳 |
Congrats! Thanks for sticking through it. This will be a very nice improvement. |
Thank you for supporting it! |
…laumeGomez rustdoc: Move label to symbol Implements rust-lang#86578 depends on rust-lang#85651 r? `@GuillaumeGomez` # Screenshot of mobile ![grafik](https://user-images.githubusercontent.com/739070/123267064-1be07f80-d4ec-11eb-8bdb-0b18a41908dc.png) # Screenshot on desktop ![grafik](https://user-images.githubusercontent.com/739070/123267204-46323d00-d4ec-11eb-97ca-2750421352f4.png)
This PR adds the container
<item-table>
with its two children<item-left>
and<item-right>
.It uses grid-layout on desktop and flexbox on mobile to make better use of the available space.
Additionally it allows to share parts of the CSS with the search function.
Desktop
Mobile
r? @GuillaumeGomez @jsha