Skip to content

Commit

Permalink
Merge pull request #888 from tubone24/a11y-emptylint
Browse files Browse the repository at this point in the history
a11y emptylink
  • Loading branch information
tubone24 authored Apr 24, 2022
2 parents e0e450d + f4dfefb commit fc85829
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 26 deletions.
39 changes: 24 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions src/__generated__/gatsby-types.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions src/components/Card/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,12 @@
color: $black;
}
}
.visually-hidden {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(50%);
clip: rect(1px, 1px, 1px, 1px);
}
}
8 changes: 7 additions & 1 deletion src/components/Card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,26 @@ const CardHeader = ({
if (index > 1) {
return (
<Link to={url}>
<span className="visually-hidden">{title}</span>
<div
className="wrapper lozad"
data-background-image={parseImgur(image, SizeMapping.large)}
title={title}
aria-hidden="true"
/>
</Link>
);
}
return (
<Link to={url}>
<span className="visually-hidden">{title}</span>
<div
className="wrapper"
style={{
backgroundImage: ` url(${parseImgur(image, SizeMapping.large)})`,
}}
title={title}
aria-hidden="true"
/>
</Link>
);
Expand Down Expand Up @@ -81,7 +85,9 @@ const Card = ({
<h4 className="title">{title}</h4>
</Link>
<p>{description}</p>
<Link to={withPrefix(url)}>....Read more....</Link>
<Link to={withPrefix(url)} aria-hidden="true">
....Read more....
</Link>
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/templates/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ const NavLink = ({
}

return (
<Link to={`${url}`} title={text}>
<NavLinkText color="#66ccff" text={text} />
<Link to={`${url}`}>
<NavLinkText color="#5252FF" text={text} />
</Link>
);
};
Expand Down

0 comments on commit fc85829

Please sign in to comment.