Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR makes some a11y improvements to the Sverdle demo.
use hidden inputs - previously, each letter guess was its own unlabeled input. There wasn't a great way to label them, and they weren't inputs you could directly interact with, so I changed them to hidden inputs instead and used
<div>
s for the tiles. This resolves 30 Axe errors.respect reduced motion for confetti and jiggle animation.
add visually hidden headings. This resolves an Axe error (no h1) and also gives landmarks so assistive tech users can easily navigate between rows.
add visually hidden text for letter state - previously, whether a letter was a correct guess or not was solely conveyed visually. This adds visually hidden text to identify a letter's state to non-sighted users. The description is taken from the NYT Wordle's hidden text (present/absent/correct/empty)
remove aria-selected - this ARIA attribute is only valid on gridcell, option, row and tab roles and was not being used on elements with those roles, so I removed it.
increase color contrast on selected tile - possibly controversial. The previous color used for a "correct" letter had really poor contrast (2.3). The new color gets to 4.6, and I think it looks okay? The variable I changed is only used for Sverdle right now.
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. All changesets should bepatch
until SvelteKit 1.0