Commit graph

30 commits

Author SHA1 Message Date
Albert Larsan
cf2dff2b1e
Move /src/test to /tests 2023-01-11 09:32:08 +00:00
Guillaume Gomez
31b39be9ce Fix tidy issues in goml scripts 2023-01-08 22:03:08 +01:00
Guillaume Gomez
009064f890 Use new block syntax for define-function in goml scripts 2023-01-06 17:52:42 +01:00
Michael Howell
5c0b60f967 rustdoc: combine common sidebar background color CSS rules 2022-12-27 14:15:49 -07:00
Matthias Krüger
e5514b9377
Rollup merge of #103251 - GuillaumeGomez:item-decl-highlighting, r=notriddle
Fix item declaration highlighting

Fixes https://github.com/rust-lang/rust/issues/103050.

As mentioned in the issue, https://github.com/rust-lang/rust/pull/102924 introduced this regression. This PR partially reverts it and adds a regression test.

r? `@notriddle`
2022-10-20 07:58:56 +02:00
Guillaume Gomez
b4e06a74ca Add regression test for item-decl highlighting 2022-10-19 21:03:11 +02:00
Michael Howell
a01b88575e rustdoc: remove class name location from sidebar sibling nav
This change tweaks the CSS to apply most of its styles to `.sidebar h2`,
cleaning up a few redundant rules from `.mobile-topbar .location` and
restoring useful navigation aids in mobile mode.
2022-10-18 12:01:53 -07:00
Michael Howell
b63b02f872 rustdoc: remove unneeded <div> wrapper from sidebar DOM
When this was added, the sidebar had a bit more complex style. It can be
removed, now.
2022-10-10 11:40:15 -07:00
Guillaume Gomez
8d19d53c60 Update rustdoc-gui test to new browser-ui-test version 2022-10-07 20:17:22 +02:00
Michael Howell
e3cb0a84c2 rustdoc: add regression test for sidebar width jank 2022-09-23 08:35:14 -07:00
Guillaume Gomez
fb2f97a37e Add GUI test for search reexports 2022-05-06 13:52:21 +02:00
Guillaume Gomez
0d928b6ed0 Update rustdoc tests to adapt to changes to the sidebar 2022-02-16 20:43:31 +01:00
Jacob Hoffman-Andrews
dd5ff428ed rustdoc: tweak line and ¶ spacing for a11y
The W3C Web Content Accessibility Guidelines specify a minimum line
spacing of 1.5 and a minimum paragraph spacing of 1.5 times the line
spacing. Our current line spacing (implemented by line-height) is 1.4,
so it's a small bump to go up to 1.5. Similarly, we have a paragraph
spacing of 0.6em. Bump that to 0.75em (which is 1.5 times the 0.5em
distance between lines).

Also, fix all the font sizes so instead of being round-ish numbers in
rem (like 1.1rem, 1.2rem), they are round numbers in pixels. Ensure each
font size is at least 2 pixels different than the nearest other font
size, so distinctions can be clearly seen. Overall the font-sizes are
mostly staying the same, being rounded up or down as appropriate.

Remove a few unused styles.

Simplify the display of the mobile-topbar location, by setting its
margins to auto rather than trying to size it exactly to the topbar.
2022-02-08 03:09:10 -08:00
Jacob Hoffman-Andrews
c20e2a9c23 Fix hover effects in sidebar
The dark and ayu themes have a menu-like highlight on sidebar items. The
light theme used to, but it was accidentally lost in the sidebar
unification. The change brings back the hover effect in the light theme.

It also makes the hover effect apply consistently to all links in the
sidebar, including headings.

It also simplifies the "In _path_" heading so it's one big link. The
breadcrumbs are still readily available at the top of the page.
2022-02-07 12:26:55 -08:00
Jacob Hoffman-Andrews
e27ebb5dff Linkify sidebar headings for sibling items
Also adjust CSS so this doesn't produce excess padding/margin.
2022-02-05 22:11:27 -08:00
Jacob Hoffman-Andrews
abffd4af08 Add white-space: nowrap to links in the sidebar
We already have overflow: hidden on these links, but if there is a
possibility to wrap, they will wrap. This happens in particular for trait
implementations because the punctuation (`<>, `) introduces opportunities
for breaks. That produces inconsistent UI. Fix it by forcing them not to
wrap.
2022-01-24 20:19:09 -08:00
Conrad Ludgate
ca3d0e2316 update tests 2022-01-23 19:26:07 +00:00
Guillaume Gomez
78cee22fb4 Add missing GUI test explanations 2022-01-21 20:41:47 +01:00
Jacob Hoffman-Andrews
6a5f8b1aef Simplify and unify rustdoc sidebar styles
This switches to just use size, weight, and spacing to distinguish
headings in the sidebar. We no longer use boxes, horizontal bars, or
centering to distinguish headings. This makes it much easier to
understand the hierarchy of headings, and reduces visual noise.

I also refactored how the mobile topbar works. Previously, we tried to
shift around elements from the sidebar to make the topbar. Now, the
topbar gets its own elements, which can be styled on their own. This
makes styling and reasoning about those elements simpler.

Because the heading font sizes are bigger, increase the sidebar width
slightly.

As a very minor change, removed version from the "All types" page. It's
now only on the crate page.
2022-01-18 10:43:14 -08:00
Jacob Hoffman-Andrews
7781636fc7 Link sidebar "location" heading to top of page
This makes it easy, when you are scrolled far down in a page, to jump
back to the top.
2022-01-14 10:41:30 -08:00
Guillaume Gomez
aa17e1c47f Fix missing bottom border for headings in sidebar 2021-11-04 20:07:24 +01:00
Jacob Hoffman-Andrews
89276ff7ed Fix documentation header sizes
And add a rustdoc-gui test confirming various header sizes.
2021-10-25 16:26:17 -07:00
Guillaume Gomez
50dc319ef0 Add test for duplicated sidebar entries for reexported macro 2021-10-20 15:44:16 +02:00
Stefan Schindler
e2efcf10de Fixing the test rustdoc by ignoring *[@id="module-item"]//following-sibling::item-right relationship and rustdoc-gui 2021-06-24 16:46:15 +02:00
Guillaume Gomez
1e222ba58a Update browser-ui-test version 2021-06-19 14:19:39 +02:00
Guillaume Gomez
466aec9957 Add test to ensure font-weight is applied correctly 2021-06-13 21:50:11 +02:00
Guillaume Gomez
45973621bc Add test to check that font-weight is correctly set on type page 2021-06-07 00:06:32 +02:00
Guillaume Gomez
9b637fa72e Improve display of the separation between page items and siblings in the sidebar 2021-05-31 15:20:45 +02:00
Guillaume Gomez
a2ba9ef1ff Only list crates on the crate page 2021-05-31 15:20:45 +02:00
Guillaume Gomez
bc888ba840 Add sidebar GUI tests 2021-05-31 10:30:16 +02:00