Open cannandev opened 6 months ago
USWDS 3.0 adds an aria-hidden attribute to images. The two shortcodes image and image_with_class only have src, cls, alt parameters. It should also support an aria parameter.
aria-hidden
src, cls, alt
aria
Example: USWDS Banner
<img aria-hidden="true" class="usa-banner__header-flag" src="/assets/img/us_flag_small.png" alt="" />
The imageWithClassShortcode function in index.js can be updated with a new parameter, whose default is true.
imageWithClassShortcode
async function imageWithClassShortcode( src, cls, alt, aria=true, ) { ... return `<img src="${pathPrefix}${data.url}" class="${cls}" alt="${alt}" aria-hidden="${aria}" loading="lazy" decoding="async">`; };
true
false
Thanks for all your hard work! 🙇🏾♀️
USWDS 3.0 adds an
aria-hidden
attribute to images. The two shortcodes image and image_with_class only havesrc, cls, alt
parameters. It should also support anaria
parameter.Notes
Example: USWDS Banner
Implementation notes
The
imageWithClassShortcode
function in index.js can be updated with a new parameter, whose default is true.Acceptance Criteria
aria-hidden
attribute, whose default value istrue
false
value to the image and image_with_class shortcodes, if necessaryThanks for all your hard work! 🙇🏾♀️