Skip to content

Shouldn't a11y warn about empty alt attribute on an image? #15867

Answered by brunnerh
MrAmericanMike asked this question in Q&A
Discussion options

You must be logged in to vote

No.

There are a lot of valid <img> uses that are merely decorative and should not have any text associated with them because it would not provide any value but rather distract 12. A warning for a missing attribute is correct because maybe it was forgotten but an empty value should be considered a conscious choice (and Svelte cannot determine whether that choice is valid in the given context).

Footnotes

  1. MDN

  2. WAI

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@MrAmericanMike
Comment options

Answer selected by MrAmericanMike
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants