docs: ⬆️ upgrade docusaurus to 2.0.0-beta.6

Signed-off-by: jffarge <jf@dagger.io>
This commit is contained in:
jffarge
2021-09-07 15:39:06 +02:00
parent a0d133c998
commit ea2c74bb4b
4 changed files with 238 additions and 147 deletions

View File

@@ -20,7 +20,7 @@ export const MainHeading = function MainHeading({...props}) {
<h1
{...props}
id={undefined} // h1 headings do not need an id because they don't appear in the TOC
className={styles.h1Heading}>
>
{props.children}
</h1>
</header>
@@ -42,8 +42,9 @@ const createAnchorHeading = (Tag) =>
<a
aria-hidden="true"
tabIndex={-1}
className={clsx('anchor', {
[styles.enhancedAnchor]: !hideOnScroll,
className={clsx('anchor', `anchor__${Tag}`, {
[styles.anchorWithHideOnScrollNavbar]: hideOnScroll,
[styles.anchorWithStickyNavbar]: !hideOnScroll,
})}
id={id}
/>
@@ -56,7 +57,7 @@ const createAnchorHeading = (Tag) =>
message: 'Direct link to heading',
description: 'Title for link to heading',
})}>
<AnchorIcon />
<AnchorIcon />
</a>
</Tag>
);

View File

@@ -5,11 +5,16 @@
* LICENSE file in the root directory of this source tree.
*/
.enhancedAnchor {
top: calc(var(--ifm-navbar-height) * -1 - 0.5rem);
/*
When the navbar is sticky, ensure that on anchor click,
the browser does not scroll that anchor behind the navbar
See https://twitter.com/JoshWComeau/status/1332015868725891076
*/
.anchorWithStickyNavbar {
scroll-margin-top: calc(var(--ifm-navbar-height) + 0.5rem);
/* top: calc(var(--ifm-navbar-height) * -1 - 0.5rem); */
}
.h1Heading {
font-size: 3rem;
margin-bottom: calc(var(--ifm-leading-desktop) * var(--ifm-leading));
.anchorWithHideOnScrollNavbar {
scroll-margin-top: 0.5rem;
}