anchor links don't hide behind the nav (#8659)

This commit is contained in:
Jeff Escalante 2020-04-02 14:26:24 -04:00 committed by GitHub
parent f13589f9fe
commit 2ab01a20b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 0 deletions

View File

@ -45,6 +45,23 @@
/* Print Styles */
@import './print.css';
/*
* About this selector:
* `.g-subnav ~ *` finds all elements after the navigation.
* `:target` finds the active permalink on the page.
*
* About this style:
* `scroll-margin-top` adjusts the vertical scroll of a permalink.
* `64px` adjusts the scroll to account for the navigation.
* `0.5em` further adjusts the scroll to give the permalink breathing room.
*
* See: https://developer.mozilla.org/en-US/docs/Web/CSS/:target
* See: https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-margin-top
*/
.g-subnav ~ * :target {
scroll-margin-top: calc(64px + 0.5em);
}
/* Layout Styles */
.g-section-block section {
padding-top: 96px;