Skip to content

Commit

Permalink
Add "Skip to Main Content" link
Browse files Browse the repository at this point in the history
  • Loading branch information
candywang committed Dec 3, 2023
1 parent b4d8cec commit 000bd8a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/components/Layout.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.skipToMainContentLink {
background-color: var(--color-sheltertech-blue);
color: var(--color-white);
font: var(--font-caption);
margin: 30px;
padding: 1em;
position: absolute;
text-align: center;
text-decoration: none;
z-index: 999;
}
4 changes: 4 additions & 0 deletions src/components/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import sealOfTransparency from "./grid-aware/Footer/stories/guidestar-seal-of-tr
import instagramLogo from "./grid-aware/Footer/stories/instagram.svg";
import twitterLogo from "./grid-aware/Footer/stories/twitter.svg";
import { BurgerMenu, Navigation } from "./grid-aware/Navigation";
import * as s from "./Layout.module.css";

Check failure on line 13 in src/components/layout.tsx

View workflow job for this annotation

GitHub Actions / Test

`./Layout.module.css` import should occur before import of `./grid-aware/Footer`

type NavItem = {
text: string;
Expand All @@ -33,6 +34,7 @@ type LayoutProps = {
const Layout = ({ children }: LayoutProps) => {
const pageWrapperID = "page-wrapper";
const outerContainerID = "outer-container";
const mainContentID = "main-content";
const [burgerMenuIsOpen, setBurgerMenuIsOpen] = useState(false);
useEffect(() => {
ReactModal.setAppElement(`#${outerContainerID}`);
Expand All @@ -48,11 +50,13 @@ const Layout = ({ children }: LayoutProps) => {
outerContainerID={outerContainerID}
/>
<div id={pageWrapperID}>
<a className={s.skipToMainContentLink} href={`#${mainContentID}`}>Skip to Main Content</a>

Check failure on line 53 in src/components/layout.tsx

View workflow job for this annotation

GitHub Actions / Test

Replace `Skip·to·Main·Content` with `⏎··········Skip·to·Main·Content⏎········`
<Navigation
homeURL="/"
navigationItems={navigationItems}
toggleBurgerMenu={() => setBurgerMenuIsOpen(!burgerMenuIsOpen)}
/>
<a id={mainContentID}></a>

Check failure on line 59 in src/components/layout.tsx

View workflow job for this annotation

GitHub Actions / Test

Anchors must have content and the content must be accessible by a screen reader

Check failure on line 59 in src/components/layout.tsx

View workflow job for this annotation

GitHub Actions / Test

The href attribute is required for an anchor to be keyboard accessible. Provide a valid, navigable address as the href value. If you cannot provide an href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/anchor-is-valid.md

Check failure on line 59 in src/components/layout.tsx

View workflow job for this annotation

GitHub Actions / Test

Empty components are self-closing
{children}
<Footer
formAction="https://sheltertech.us19.list-manage.com/subscribe/post?u=c47829732a0bea5c8e8a94604&amp;id=08f60e42ef"
Expand Down

0 comments on commit 000bd8a

Please sign in to comment.