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

A11y fixes and other minor issues #924

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion components/Nav/SidebarMenus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const DocsSidebarMenu = (props: DocsSidebarMenuProps) => {
return (
<MenuInner>
{pages.map(({ title, pathname, sections }) => (
<Section>
<Section key={title}>
<SectionTitle>
<Link href={`/docs/${pathname}`}>{title}</Link>
</SectionTitle>
Expand Down
4 changes: 2 additions & 2 deletions components/Slider/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function Navigation({ prev, next }: NavigationProps) {
return (
<TransitionGroup>
<CSSTransition key={props.src} timeout={100} classNames="fade">
<img src={prev.src} />
<img src={prev.src} role="presentation" />
</CSSTransition>
</TransitionGroup>
);
Expand All @@ -47,7 +47,7 @@ export default function Navigation({ prev, next }: NavigationProps) {
return (
<TransitionGroup>
<CSSTransition key={props.src} timeout={100} classNames="fade">
<img src={next.src} />
<img src={next.src} role="presentation" />
</CSSTransition>
</TransitionGroup>
);
Expand Down
2 changes: 1 addition & 1 deletion pages/showcase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default function Showcase() {
return (
<TransitionGroup>
<CSSTransition key={src} timeout={500} classNames="fade">
<img {...props} />
<img {...props} role="presentation" />
</CSSTransition>
</TransitionGroup>
);
Expand Down
2 changes: 1 addition & 1 deletion sections/api/helpers/is-styled-component.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const ParentComponent = styled.div`
color: royalblue;

${TargetedComponent} {
color: tomato;
Copy link
Contributor

Choose a reason for hiding this comment

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

For this one we were using html color names just for legibility, maybe you could find an alternate named color? https://en.wikipedia.org/wiki/Web_colors

Copy link
Author

Choose a reason for hiding this comment

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

@probablyup, none of the orange colors do not pass the contrast ratio, how about using any of these colors (and adjusting the examples accordingly)?
image
Or, I can revert the color changes and merge only the other fixes?

color: #E42200;
}
`
```
2 changes: 1 addition & 1 deletion sections/api/primary/styled.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const Button = styled.button`
`

const TomatoButton = styled(Button)`
background: tomato;
background: #E42200;
`

render(
Expand Down
2 changes: 1 addition & 1 deletion sections/api/supported-css.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const Example = styled.div`

/* media queries are no problem */
@media (max-width: 600px) {
background: tomato;
background: #E42200;

/* nested rules work as expected */
&:hover {
Expand Down
8 changes: 4 additions & 4 deletions sections/basics/extending-styles.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ const Button = styled.button`

// A new component based on Button, but with some override styles
const TomatoButton = styled(Button)`
color: tomato;
border-color: tomato;
color: #E42200;
border-color: #E42200;
`;

render(
Expand Down Expand Up @@ -48,8 +48,8 @@ const Button = styled.button`
`;

const TomatoButton = styled(Button)`
color: tomato;
border-color: tomato;
color: #E42200;
border-color: #E42200;
`;

render(
Expand Down
20 changes: 15 additions & 5 deletions test/components/NavBar/__snapshots__/index.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,9 @@ exports[`Nav renders correctly 1`] = `
<div
className="c21"
>
<styled.div>
<styled.div
key="Basics"
>
<div
className="c22"
>
Expand Down Expand Up @@ -1045,7 +1047,9 @@ exports[`Nav renders correctly 1`] = `
</styled.h5>
</div>
</styled.div>
<styled.div>
<styled.div
key="Advanced"
>
<div
className="c22"
>
Expand Down Expand Up @@ -1217,7 +1221,9 @@ exports[`Nav renders correctly 1`] = `
</styled.h5>
</div>
</styled.div>
<styled.div>
<styled.div
key="API Reference"
>
<div
className="c22"
>
Expand Down Expand Up @@ -1353,7 +1359,9 @@ exports[`Nav renders correctly 1`] = `
</styled.h5>
</div>
</styled.div>
<styled.div>
<styled.div
key="Tooling"
>
<div
className="c22"
>
Expand Down Expand Up @@ -1507,7 +1515,9 @@ exports[`Nav renders correctly 1`] = `
</styled.h5>
</div>
</styled.div>
<styled.div>
<styled.div
key="FAQs"
>
<div
className="c22"
>
Expand Down
20 changes: 15 additions & 5 deletions test/components/__snapshots__/DocsLayout.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,9 @@ exports[`DocsLayout renders correctly 1`] = `
<div
className="c22"
>
<styled.div>
<styled.div
key="Basics"
>
<div
className="c23"
>
Expand Down Expand Up @@ -1134,7 +1136,9 @@ exports[`DocsLayout renders correctly 1`] = `
</styled.h5>
</div>
</styled.div>
<styled.div>
<styled.div
key="Advanced"
>
<div
className="c23"
>
Expand Down Expand Up @@ -1306,7 +1310,9 @@ exports[`DocsLayout renders correctly 1`] = `
</styled.h5>
</div>
</styled.div>
<styled.div>
<styled.div
key="API Reference"
>
<div
className="c23"
>
Expand Down Expand Up @@ -1442,7 +1448,9 @@ exports[`DocsLayout renders correctly 1`] = `
</styled.h5>
</div>
</styled.div>
<styled.div>
<styled.div
key="Tooling"
>
<div
className="c23"
>
Expand Down Expand Up @@ -1596,7 +1604,9 @@ exports[`DocsLayout renders correctly 1`] = `
</styled.h5>
</div>
</styled.div>
<styled.div>
<styled.div
key="FAQs"
>
<div
className="c23"
>
Expand Down