Skip to content

Commit

Permalink
content/static,devtools,internal: update header to spec
Browse files Browse the repository at this point in the history
This change implements the latest designs for the site header,
adds a new fixed header to details pages, and updates to the
latest Closure Compiler Docker image tag to support an API used
by the new fixed header implementation (ResizeObserver).

The global header is no longer sticky, but on the details page
a hybrid header that shows a combination of the header content
and details tabs is displayed when the inline tab list goes out
of view.

Both the inline and fixed tab lists are responsive in that the
elements are pushed to an overflow container when they can no
longer fit on screen. A native <select> tag is used for this to
avoid implementing a popup menu (perhaps that can be done in a
future change).

The mechanism used to copy the current path to the clipboard has
also been updated to avoid hacks that didn’t play well with
screen readers. This method does not work on iOS, but a message
is displayed to the user in that case.

Fixes golang/go#37110

Change-Id: I2b8b73d7e85c122992b106e9b89d7e207be9f099
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/245400
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
  • Loading branch information
andybons authored and julieqiu committed Jul 30, 2020
1 parent 2c7f09d commit 98472f3
Show file tree
Hide file tree
Showing 19 changed files with 886 additions and 333 deletions.
7 changes: 4 additions & 3 deletions content/static/css/sidenav.css
Expand Up @@ -23,8 +23,9 @@
height: 3rem;
margin: 0 -1rem;
position: sticky;
top: 4rem; /* The site header height on mobile */
top: var(--header-height);
transition: box-shadow 0.2s linear;
z-index: 1000;
}
.DocNavMobile--withShadow {
box-shadow: 0 0.1875rem 0.1875rem rgba(0, 0, 0, 0.2);
Expand Down Expand Up @@ -106,13 +107,13 @@
}
.DocNav {
display: block;
max-height: calc(100vh - 6.511rem); /* 6.511rem is the site header height */
max-height: calc(100vh - var(--header-height));
overflow-x: hidden;
overflow-y: scroll;
padding-top: 1rem;
padding-left: 0.25rem;
position: sticky;
top: 6.511rem;
top: var(--header-height);
}
.DocNavMobile {
display: none;
Expand Down

0 comments on commit 98472f3

Please sign in to comment.