Skip to content

Commit a0a9d30

Browse files
committed
move main-content anchor to content div
for parsing by DocSearch, retains same skip-link functionality
1 parent a763283 commit a0a9d30

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

src/components/Layout.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import SideNavMobile from "./SideNavMobile"
1515
import TranslationBanner from "./TranslationBanner"
1616
import TranslationBannerLegal from "./TranslationBannerLegal"
1717
import FeedbackWidget from "./FeedbackWidget"
18-
import { SkipLink, SkipLinkAnchor } from "./SkipLink"
18+
import { SkipLink } from "./SkipLink"
1919

2020
import { ZenModeContext } from "../contexts/ZenModeContext"
2121

@@ -135,8 +135,11 @@ const Layout: React.FC<IProps> = ({
135135
<Nav path={path} />
136136
{shouldShowSideNav && <SideNavMobile path={path} />}
137137
</ZenMode>
138-
<SkipLinkAnchor id="main-content" />
139-
<Flex flexDirection={{ base: "column", lg: "row" }}>
138+
<Flex
139+
flexDirection={{ base: "column", lg: "row" }}
140+
id="main-content"
141+
scrollMarginTop={20}
142+
>
140143
{shouldShowSideNav && (
141144
<ZenMode>
142145
<SideNav path={path} />

src/components/SkipLink.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,3 @@ export const SkipLink: React.FC<IProps> = ({ hrefId }) => {
2727
</Box>
2828
)
2929
}
30-
31-
export const SkipLinkAnchor: React.FC<{ id: string }> = ({ id }) => {
32-
return <Box height="80px" mt="-80px" id={id}></Box>
33-
}

0 commit comments

Comments
 (0)