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

✨ Site accessibility improvements #4131

Merged
merged 11 commits into from
Dec 4, 2024
Merged

✨ Site accessibility improvements #4131

merged 11 commits into from
Dec 4, 2024

Conversation

ikesau
Copy link
Member

@ikesau ikesau commented Nov 9, 2024

Some QOL things I noticed + Lighthouse recommendations

A few +/-5% lightness adjustments here and there because the background colour isn't white, because that's easier than adding $blue-61

I showed the *:focus-within rule to Marwa and she's happy with it 👍

@ikesau ikesau requested a review from rakyi November 9, 2024 00:39
@owidbot
Copy link
Contributor

owidbot commented Nov 9, 2024

Quick links (staging server):

Site Admin Wizard Docs

Login: ssh owid@staging-site-a11y

SVG tester:

Number of differences (default views): 2057 (a01871) ❌
Number of differences (all views): 1474 (6c137f) ❌

Edited: 2024-12-03 16:14:42 UTC
Execution time: 1.42 seconds

@ikesau ikesau removed the request for review from rakyi November 11, 2024 05:11
@ikesau ikesau requested a review from rakyi November 15, 2024 17:18
/**
* Convert 0 to "0th", 1 to "1st", etc.
* */
export function getOrdinalNumberString(n: number): string {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a big deal, but consider using Intl.PluralRules, which would make this more readable (IMHO) and standardized.

Copy link
Contributor

Choose a reason for hiding this comment

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

@rakyi Just a drive by comment to say thanks for mentioning this, I didn't know about it and this seems pretty neat. Maybe post about it on slack in developers or tools-and-workflows?

// inert isn't supported in react@17
// prevents focus on elements that are not visible
// ideally would only apply to elements below the fold but that's hard
{...{ inert: isClosed ? "true" : undefined }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this really what we want? What problem do we solve? It also prevents users from selecting text within the element, and the text will be excluded from browser search, which seems too harsh.

Copy link
Member Author

Choose a reason for hiding this comment

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

The issue I was trying to address here is that you can tab through links that are hidden, which renders poorly (see the video.)

I tried setting up a prop that would set tabIndex="-1" on any nested span-link elements but couldn't get it to work in the small amount of time I was budgeting for this PR so I went with this simpler solution instead.

I'm open to changing this though, if you think this change is an overall downgrade 🙂

tabbing.mov

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, I'm not sure what's better. Let's go with what you did and revert/rework later, if necessary.

...restProps
}: ComponentPropsWithRef<"button">) {
}: ComponentPropsWithRef<"button"> & { index: number }) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, I was meaning to change this to a div instead of a button and remove the interactivity. The buttons are too small for touch navigation — it was flagged as such by some other web test tool I used. Should we do that instead?

Copy link

github-actions bot commented Dec 3, 2024

This PR has had no activity within the last two weeks. It is considered stale and will be closed in 3 days if no further activity is detected.

@github-actions github-actions bot added the stale label Dec 3, 2024
@ikesau ikesau removed the stale label Dec 3, 2024
@ikesau ikesau merged commit e33bb0d into master Dec 4, 2024
19 of 21 checks passed
@ikesau ikesau deleted the a11y branch December 4, 2024 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants