2021-07-15 20:12:28 +00:00
|
|
|
// This test ensure that the sidebar isn't "hidden" on mobile but instead moved out of the viewport.
|
|
|
|
// This is especially important for devices for "text-first" content (like for users with
|
|
|
|
// sight issues).
|
|
|
|
goto: file://|DOC_PATH|/test_docs/struct.Foo.html
|
|
|
|
// Switching to "mobile view" by reducing the width to 600px.
|
|
|
|
size: (600, 600)
|
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-07 00:48:24 +00:00
|
|
|
assert-css: (".sidebar", {"display": "block", "left": "-1000px"})
|
2021-07-15 20:12:28 +00:00
|
|
|
// Opening the sidebar menu.
|
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-07 00:48:24 +00:00
|
|
|
click: ".sidebar-menu-toggle"
|
|
|
|
assert-css: (".sidebar", {"display": "block", "left": "0px"})
|
2021-07-16 15:04:49 +00:00
|
|
|
// Closing the sidebar menu.
|
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-07 00:48:24 +00:00
|
|
|
click: ".sidebar-menu-toggle"
|
|
|
|
assert-css: (".sidebar", {"display": "block", "left": "-1000px"})
|
2021-07-16 15:04:49 +00:00
|
|
|
// Force the sidebar open by focusing a link inside it.
|
|
|
|
// This makes it easier for keyboard users to get to it.
|
2021-07-17 18:53:59 +00:00
|
|
|
focus: ".sidebar-title a"
|
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-07 00:48:24 +00:00
|
|
|
assert-css: (".sidebar", {"display": "block", "left": "0px"})
|
2021-07-16 15:04:49 +00:00
|
|
|
// When we tab out of the sidebar, close it.
|
|
|
|
focus: ".search-input"
|
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-07 00:48:24 +00:00
|
|
|
assert-css: (".sidebar", {"display": "block", "left": "-1000px"})
|
2022-01-12 02:27:44 +00:00
|
|
|
|
|
|
|
// Open the sidebar menu.
|
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-07 00:48:24 +00:00
|
|
|
click: ".sidebar-menu-toggle"
|
|
|
|
assert-css: (".sidebar", {"left": "0px"})
|
2022-01-12 02:27:44 +00:00
|
|
|
|
|
|
|
// Click elsewhere.
|
|
|
|
click: "body"
|
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-07 00:48:24 +00:00
|
|
|
assert-css: (".sidebar", {"display": "block", "left": "-1000px"})
|
|
|
|
|
|
|
|
// Check that the topbar is visible
|
|
|
|
assert-property: (".mobile-topbar", {"clientHeight": "45"})
|