| Age | Commit message (Collapse) | Author | Lines |
|
This commit should result in no appearance changes.
To make the logo container exactly the desired height, you want to get rid
of the part of the box used for typographic descenders (you know, the part
of g, y, and j that descends below the baseline). After all, it contains no
text, but the space is still left open in the layout by default, because
`<img>` is `display:inline`. The CSS used to employ three different tricks
to accomplish this:
* By making `.sidebar .logo-container` a flex container, the image becomes
a flex item and is [blockified], without synthesizing any inline boxes.
No inline boxes means no descenders.
* By giving `.mobile-topbar .logo-container` a max-height exactly the same
as the height of the image plus the padding, the descender area gets
cut off.
* By setting `.sub-logo-container { line-height: 0 }`, we ensure that the
only box that contributes to the height of the line box is the image
itself, and not any zero-content text boxes that neighbor it. See the
[logical height algorithm].
This commit gets rid of the first two hacks, leaving only the third,
since it requires only one line of code to accomplish and doesn't require
setting the value based on math.
[blockified]: https://drafts.csswg.org/css-flexbox-1/#flex-items
[logical height algorithm]: https://www.w3.org/TR/css-inline-3/#inline-height
|
|
|
|
There is a layout change caused by this commit, but it's subtle. You won't
notice it unless you're looking for it.
|
|
function pointers
for consistency with the way we display local definitions (cleaned from HIR, not from rustc_middle).
|
|
r=notriddle
Remove rustdoc clean::Visibility type
Fixes #90852.
Follow-up of https://github.com/rust-lang/rust/pull/103690.
This PR completely removes the rustdoc `clean::Visibility` type to use the `rustc_middle` one instead. I don't think there will be any impact on perf.
r? `@notriddle`
|
|
notriddle:notriddle/main-content-item-info-margin-top, r=GuillaumeGomez
rustdoc: remove no-op CSS `#main-content > .item-info { margin-top: 0 }`
When this line was added in 04b4c40682c01cad8f9bc8d5b3907be91d6f81d4, it overrode a negative `margin-top` that was set on it by default.
https://github.com/rust-lang/rust/blob/04b4c40682c01cad8f9bc8d5b3907be91d6f81d4/src/librustdoc/html/static/rustdoc.css#L500-L516
That negative top margin was removed in 593d6d1cb15c55c88319470dabb40126c7b7f1e2.
|
|
r=GuillaumeGomez
rustdoc: clean up hardcoded CSS border color on search results
Hardcoded colors in rustdoc.css should usually be avoided.
Preview: http://notriddle.com/notriddle-rustdoc-demos/border-bottom-search/test_dingus/?search=test
|
|
r=GuillaumeGomez
rustdoc: remove redundant mobile CSS `.sidebar-elems { background }`
The exact same background is already set for its parent, the `nav.sidebar`.
|
|
When this line was added in 04b4c40682c01cad8f9bc8d5b3907be91d6f81d4, it
overrode a negative `margin-top` that was set on it by default.
https://github.com/rust-lang/rust/blob/04b4c40682c01cad8f9bc8d5b3907be91d6f81d4/src/librustdoc/html/static/rustdoc.css#L500-L516
That negative top margin was removed in
593d6d1cb15c55c88319470dabb40126c7b7f1e2.
|
|
Hardcoded colors in rustdoc.css should usually be avoided.
|
|
|
|
The exact same background is already set for its parent, the `nav.sidebar`.
|
|
r=GuillaumeGomez
rustdoc: remove unused mobile CSS `.rustdoc { padding-top: 0 }`
When this rule was added in dd437ee6ed81f85c715bf415d261feca484bb39f, as `body { padding-top: 0 }`, the desktop body tag had non-zero top padding. This padding was removed in 135281ed1525db15edd8ebd092aa10aa40df2386.
This rule no longer overrides a rule in rustdoc's desktop styles, and also doesn't override the UA stylesheet, since the [HTML standard] has only margin, not padding, on the page body.
[HTML standard]: https://html.spec.whatwg.org/multipage/rendering.html#the-page
|
|
When this rule was added in dd437ee6ed81f85c715bf415d261feca484bb39f, as
`body { padding-top: 0 }`, the desktop body tag had non-zero top padding.
This padding was removed in 135281ed1525db15edd8ebd092aa10aa40df2386.
This rule no longer overrides a rule in rustdoc's desktop styles, and also
doesn't override the UA stylesheet, since the [HTML standard] has only
margin, not padding, on the page body.
[HTML standard]: https://html.spec.whatwg.org/multipage/rendering.html#the-page
|
|
r=GuillaumeGomez
rustdoc: simplify mobile item-table CSS
Using flexbox in column direction is needlessly complicated, since no special flex powers are being used here. Just use regular block layout.
This should result in no visible changes.
|
|
Make rustdoc Item::visibility computed on-demand
This is a take-over of https://github.com/rust-lang/rust/pull/91408.
Helps with https://github.com/rust-lang/rust/issues/90852 (needs to use `ty::Visibility` directly too).
cc `@camelid`
r? `@notriddle`
|
|
Using flexbox in column direction is needlessly complicated, since no
special flex powers are being used here. Just use regular block layout.
This should result in no visible changes.
|
|
rustdoc: rename syntax highlighting CSS class `attribute` to `attr`
Link classes use the abbreviation `attr` ...
https://github.com/rust-lang/rust/blob/2afca78a0b03db144c5d8b9f8868feebfe096309/src/librustdoc/html/static/css/rustdoc.css#L255-L259
... so why does syntax highlighting use the full word?
https://github.com/rust-lang/rust/blob/2afca78a0b03db144c5d8b9f8868feebfe096309/src/librustdoc/html/static/css/rustdoc.css#L1095-L1097
|
|
r=GuillaumeGomez
rustdoc: remove unnecessary CSS `.search-results { clear: both }`
Since the tabs use flexbox instead of float as of 44d9b8d07014d976c88f541dbe0af37e64e37bdd, clearing does nothing.
|
|
r=GuillaumeGomez
rustdoc: add margins to all impl-item toggles, not just methods
Fixes #103782
## Before

## After

|
|
|
|
This allows people to treat them like real links, such as right-click to
copy URL, and makes the line numbers in a scraped example work at all,
when before this commit was added, they had the clickable pointer cursor
but did not actually do anything when clicked.
|
|
Link classes use the abbreviation `attr`, so why shouldn't
syntax highlighting?
|
|
Since the tabs use flexbox instead of float as of
44d9b8d07014d976c88f541dbe0af37e64e37bdd, clearing does nothing.
|
|
Fixes #103782
|
|
r=jsha,GuillaumeGomez
rustdoc: clean up `#toggle-all-docs`
This change converts the element from an `<a>` link to a button. It's pretty much directly trading slightly more CSS for slightly less HTML, and it's also semantically correct (so you don't get a broken "bookmark" option when you right click on it).
While doing this, I also got rid of the unnecessary `class="inner"` attribute on the inner span. There was a style targeting `.collapse-toggle > .inner`, but no CSS ever targeted the `#toggle-all-docs > .inner`.
Preview: https://notriddle.com/notriddle-rustdoc-test/button-toggle-all-docs/index.html
|
|
|
|
rustdoc: Simplify modifications of effective visibility table
It is now obvious that rustdoc only calls `set_access_level` with foreign def ids and `AccessLevel::Public`.
The second commit makes one more step and separates effective visibilities coming from rustc from similar data collected by rustdoc for extern `DefId`s.
The original table is no longer modified and now only contains local def ids as populated by rustc.
cc https://github.com/rust-lang/rust/pull/102026 `@Bryanskiy`
|
|
r=Dylan-DPC
rustdoc: remove unnecessary CSS `.search-results { padding-bottom }`
There's nothing underneath it anyway. The conversation on #84462 never really spelled out why it was added.
|
|
rustdoc: use CSS margin/padding shorthand when all are being set
|
|
Fix z-indexes of code example feature and cleanup its CSS
When reviewing https://github.com/rust-lang/rust/pull/103650, I realized that the `z-index`es of this feature were completely broken:

This PR fixes it by reducing the value of value under the one used for `.popover` (it could be completely removed but then it wouldn't be displayed as nicely).
There was also a lot of duplicated CSS so I merged the rules.
r? `@notriddle`
|
|
Co-authored-by: Michael Howell <michael@notriddle.com>
|
|
|
|
|
|
All static files used by rustdoc are now stored in static.files/ and
include a hash of their contents. They no longer include the contents of
the --resource-suffix flag. This clarifies caching semantics. Anything
in static.files can use Cache-Control: immutable because any updates
will show up as a new URL.
Invocation-specific files like crates-NN.js, search-index-NN.js,
and sidebar-items-NN.js still get the resource suffix.
The --disable-minification flag is removed because it would vary the
output of static files based on invocation flags. Instead, for
rustdoc development purposes it's preferable to symlink static files
to a non-minified copy for quick iteration.
|
|
rustdoc for external def-ids
|
|
There's nothing underneath it anyway. The conversation on
b615c0c85469c94041a5e68b9d8b68dcf799f9f1 never really spelled out why it
was added.
|
|
|
|
|
|
rustdoc: remove redundant CSS/DOM `div.search-container`
Preview: https://notriddle.com/notriddle-rustdoc-demos/search-container/test_dingus/fn.test.html
This wrapper DIV was originally added in 89e1fb322321c05497caa01372ceb7d5b57fa680, when it allowed the search bar's size to be calculated without using `calc()`. This `width` hack can be removed using flexbox.
|
|
privacy: Rename "accessibility levels" to "effective visibilities"
And a couple of other naming and comment tweaks.
Related to https://github.com/rust-lang/rust/issues/48054
For `enum Level` I initially used naming `enum EffectiveVisibilityLevel`, but it was too long and inconvenient because it's used pretty often.
So I shortened it to just `Level`, if it needs to be used from some context where this name would be ambiguous, then it can be imported with renaming like `use rustc_middle::privacy::Level as EffVisLevel` or something.
|
|
r=GuillaumeGomez
rustdoc: stop hiding focus outlines on non-rustdoc-toggle details tags
We really shouldn't be overriding this kind of stuff unless the browser default is really broken (like outlining the thing that isn't clickable). This directly reverts b8f4e74cbc938d3448507d422c98061c2b71c922.
|
|
Migrate source line numbers CSS to CSS variables
Part of https://github.com/rust-lang/rust/pull/98460.
No UI changes.
r? ``@notriddle``
|
|
This wrapper DIV was originally added in
89e1fb322321c05497caa01372ceb7d5b57fa680, when it allowed the search bar's
size to be calculated without using `calc()`. This `width` hack can be
removed using flexbox.
|
|
We really shouldn't be overriding this kind of stuff unless the browser
default is really broken (like outlining the thing that isn't clickable).
This directly reverts b8f4e74cbc938d3448507d422c98061c2b71c922.
|
|
rustdoc: remove CSS workaround for Firefox 29
CSS variables, which rustdoc now relies on, are only supported in Firefox 31 and later: https://www.mozilla.org/en-US/firefox/31.0/releasenotes/
This means it’s fine to also rely on unprefixed box-sizing, which is supported in Firefox 29 and later: https://www.mozilla.org/en-US/firefox/29.0/releasenotes/
|
|
|
|
r=GuillaumeGomez
rustdoc: remove redundant CSS selector `.notable-traits .notable`
The margin was already being set to 0 only a few lines lower.
|
|
CSS variables, which rustdoc now relies on, are only supported in Firefox 31 and later: https://www.mozilla.org/en-US/firefox/31.0/releasenotes/
This means it’s fine to also rely on unprefixed box-sizing, which is supported in Firefox 29 and later: https://www.mozilla.org/en-US/firefox/29.0/releasenotes/
|
|
rustdoc: combine shared CSS between `.*-line-numbers`
Example: https://notriddle.com/notriddle-rustdoc-demos/line-numbers/test_dingus/fn.test.html
This PR should result in no visible changes. The example is here, so it can be easily tested in different browsers.
|