Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add skip-to-content button #7235

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions apps/site/components/withNavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useLocale } from 'next-intl';
import { useTheme } from 'next-themes';
import type { FC } from 'react';

import Button from '@/components/Common/Button';
import NavBar from '@/components/Containers/NavBar';
import WithBanner from '@/components/withBanner';
import { useSiteNavigation } from '@/hooks';
Expand All @@ -23,6 +24,15 @@ const WithNavBar: FC = () => {

return (
<div>
<Button
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be a link instead of a button, something basic (like GitHub) could be considered for styling

className={
'!fixed left-0 m-3 -translate-y-16 p-3 !transition focus:translate-y-0'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the transitions should be motion-safe, and avoid adding important

}
href="#main-content"
>
Skip Navigation
</Button>

<WithBanner section="index" />

<NavBar
Expand All @@ -38,6 +48,7 @@ const WithNavBar: FC = () => {
target,
}))}
/>
<a id="main-content" />
</div>
);
};
Expand Down
Loading