A11Y Improvements: Add Alt Attribute from Post Metadata Or Default to Empty Value #27
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.
Closes #19
Expected
Screen reader users should be able to
What this PR does
This adds the ability for blog authors to provide an alternative text for header images that will be set as to the
alt
attribute via theimageMeta.alt
property. If noimageMeta.alt
is provided it will default to""
which in turn applies an emptyalt
attribute to the image instead.How to reproduce
alt
text if one is available or 2. skipping the image entirely no description of the image is availableYou can also review the shortcuts for VoiceOver for navigating websites over here
Demos
Example Informative Image
Example Decorative Image
alt=""
vs.alt
It seems both the empty attribute syntax with an empty string value (
<img alt="">
) as well as the sole use of thealt
attribute (<img alt>
) can be used interchangeably as valid implementations of the WCAG guidelines for decorative images when following the spec of the empty attribute syntax: