| Age | Commit message (Collapse) | Author | Lines |
|
r=GuillaumeGomez
rustdoc: omit start/end tags for empty item description blocks
Related to #100952
This is definitely not a complete solution, but it does shrink keysyms/index.html on smithay from 620K to 516K.
|
|
Fixes #100994
This selector was added in c7312fbae4979c6d4fdfbd1f55a71cd47d82a480.
The bug can be seen at <https://doc.rust-lang.org/1.27.0/alloc/slice/trait.SliceIndex.html#foreign-impls>.
This rule was added to help with a `<table>` that was used for displaying the
function signature [src] lockup. That lockup was changed in
34bd2b845b3acd84c5a9bddae3ff8081c19ec5e9 to use flexbox instead, leaving this
selector unused (at least, for its original purpose).
|
|
Related to #100952
This is definitely not a complete solution, but it does shrink
keysyms/index.html on smithay from 620K to 516K.
|
|
|
|
|
|
|
|
|
|
|
|
GuillaumeGomez:improve_rustdoc_search_results_page_crates_selection, r=notriddle
Improve crate selection on rustdoc search results page
Take over of #98855 (screenshots and explanations are there).
You can test it [here](https://rustdoc.crud.net/imperio/improve_rustdoc_search_results_page_crates_selection/std/index.html?search=test).
cc ``@steffahn`` ``@jsha``
r? ``@notriddle``
|
|
Previously the item-info background colors were too bright for a dark
theme, making a bright rectangle that draws the attention.
|
|
|
|
Resolves all of issue #93240
Reproduces a similar change as #99086, but with improvements
In particular, this PR inlcludes:
* redesigning the crate-search selector so the background color matches its surroundings
* decrease the font of the dropdown menu to a reaonable size
* add a hover effect
* make the color of the arrow theme-dependent, using a surrounding div, with :after pseudo-element
that can then be transformed using CSS filters to approximate the desired color
* fix the text "in" to match the title font
* remove the "for xyz" in the "Results for xyz in [All crates]" title when
searching for search term "xyz"; you can already see what you're searching for
as it's typed in the search bar!
* in line with #99086, handle super-long crate names appropriately without a long <select>
element escaping the screen area; the improvement is that we also keep the title
within a single line now; uses some flex layout shenanigans...
* the margins / paddings are adjusted so the selected label of the <select> fits within
the rest of that title nicely; also some inconsistency in the way that Firefox renders
a <select> with "appearance: none" (roughly 4px more padding left and right of the text
than e.g. Chrome) is worked around, and it now produces a result that looks (essentially)
identical to Chrome
* the color of the help menu and settings menu border in light theme is made to match with
the color of the corresponding buttons, like they do (match) in the ayu theme
* the casing of "All crates" changes to "all crates"
* the new tests from #99086 are temporarily disabled, until they can be adapted later
|
|
rustdoc: improve scroll locking in the rustdoc mobile sidebars
This PR prevents the main content area from scrolling while the mobile sidebar is open on documentation pages (porting the scroll locking behavior from the source sidebar to the regular sidebar), and also fixes some bad behavior where opening a "mobile" sidebar, and growing the viewport so that the "desktop" mode without scroll locking is activated, could potentially leave the page stuck.
This does not affect the behavior on larger screens. Only small ones, where the sidebar covers up the main content.
Split out from #98772
|
|
r=notriddle
Fix item info pos and height
Fixes https://github.com/rust-lang/rust/issues/98266.
Fixes https://github.com/rust-lang/rust/issues/98343.
You can test it [here](https://rustdoc.crud.net/imperio/fix-item-info-pos-and-height/lib2/trait.Trait.html).
Here is a screenshot of the result:

r? `@jsha`
|
|
r=notriddle
Fix settings slider on small width screens
Fixes #99794.
Screenshot of the fix:

cc `````@jsha`````
r? `````@notriddle`````
|
|
Fix headings colors
Fixes #99797.

cc `@jsha`
r? `@notriddle`
|
|
|
|
|
|
|
|
|
|
rustdoc UI fixes
The first commit fixes this bug:


The second one fixes the missing change of border color when the search input is focused.
cc `@jsha`
r? `@notriddle`
|
|
|
|
|
|
|
|
|
|
|
|
This commit ports the scroll locking behavior from the source sidebar to the
regular sidebar, and also fixes some bad behavior where opening a "mobile"
sidebar, and growing the viewport so that the "desktop" mode without scroll
locking is activated, could potentially leave the page stuck.
This does not affect the behavior on larger screens. Only small ones, where
the sidebar covers up the main content.
|
|
Instead of generating `#impl`, `#impl-1`, etc., generate IDs
like `#impl-Foo<M>`.
Co-authored-by: Noah Lev <camelidcamel@gmail.com>
|
|
r=GuillaumeGomez
rustdoc: improve click behavior of the source code mobile full-screen "sidebar"
On desktop, if you open the source code sidebar, it stays open even when you move from page to page. It used to do the same thing on mobile, but I think that's stupid. Since the file list fills the entire screen on mobile, and you can't really do anything with the currently selected file other than dismiss the "sidebar" to look at it, it's safe to assume that anybody who clicks a file in that list probably wants the list to go away so they can see it.
Split out separately from #98772
|
|
r=GuillaumeGomez
rustdoc: make source sidebar toggle a real button
This fixes tab focus, so that you can open and close the sidebar from keyboard.
This should cause no visible change in appearance at all. The only way you'd know anything different is if you tried to use keyboard controls to open the source code file navigation sidebar.
Separated out from #98772
|
|
r=GuillaumeGomez
rustdoc: use <details> tag for the source code sidebar
This fixes the extremely poor accessibility of the old system, making it possible to navigate the sidebar by keyboard, and also implicitly gives the sidebar items the correct ARIA roles.
Split out separately from #98772
|
|
|
|
|
|
|
|
|
|
`<details>`/`<summary>` UI fixes
With images it's easier to understand:


The headings in `<summary>` should not have bottom border so I removed it as well alongside the other fixes.
r? `@jsha`
|
|
On desktop, if you open the source code sidebar, it stays open even when you
move from page to page. It used to do the same thing on mobile, but I think
that's stupid. Since the file list fills the entire screen on mobile, and you
can't really do anything with the currently selected file other than dismiss
the "sidebar" to look at it, it's safe to assume that anybody who clicks a
file in that list probably wants the list to go away so they can see it.
|
|
This fixes the extremely poor accessibility of the old system, making it
possible to navigate the sidebar by keyboard, and also implicitly gives the
sidebar items the correct ARIA roles.
|
|
Fix source sidebar bugs
This PR fixes the following two bugs:


I added regression tests to prevent them to happen again.
I think we should backport it to beta as well.
You can test it [here](https://rustdoc.crud.net/imperio/source-sidebar-fixes/src/std/lib.rs.html).
cc ```@jsha```
r? ```@notriddle```
|
|
sidebar
|
|
|
|
|
|
|
|
|
|
This commit fixes the keyboard shorts code to call localStorage every time a
key is pressed. This matters because you're supposed to be able to change a
setting and have it immediately take effect.
|
|
|
|
Transform help popup into a pocket menu
Just like we moved the settings menu into a "pocket menu", it's doing the same to the help popup.
You can test it [here](https://rustdoc.crud.net/imperio/help-pocket-menu/doc/foo/index.html) and here is a screenshot:

r? ``````````@jsha``````````
|
|
|
|
rustdoc: optimize loading of source sidebar
The source sidebar has a setting to remember whether it should be open or
closed. Previously, this setting was handled in source-script.js, which
is loaded with `defer`, meaning it is often run after the document is rendered.
Since CSS renders the source sidebar as closed by default, changing this
after the initial render results in a relayout.
Instead, handle the setting in storage.js, which is the first script to load
and is the only script that blocks render. This avoids a relayout and means
navigating between files with the sidebar open is faster.
Demo: https://rustdoc.crud.net/jsha/defer-source-sidebar/src/alloc/ffi/c_str.rs.html
r? ````@GuillaumeGomez````
|
|
|