Gridsome: alt tag missing warning for <g-image>

Created on 30 Apr 2019  路  3Comments  路  Source: gridsome/gridsome

Summary

Missing alt text on images is bad for accessibility and gives lower lighthouse scores. We should give a warning if alt tag is missing on .

Basic example

Svelte does this. Try to remove the alt tag here:
https://svelte.dev/examples#dynamic-attributes

And you get a warning:
A11y: element should have an alt attribute (7:0)

Motivation

To help people build more accessible websites.

feature request

Most helpful comment

Slightly different recommendation here. Images without alt text should get an empty alt tag. Not all images need alt text, but if no alt tag is provided then assistive tech will read out the image src URL instead. 馃槵

More on this: https://davidwalsh.name/accessibility-tip-empty-alt-attributes

All 3 comments

Does it concerns @gridsome/transformer-remark too ?

![](./img/logo.jpg) no alt in HTML.

Slightly different recommendation here. Images without alt text should get an empty alt tag. Not all images need alt text, but if no alt tag is provided then assistive tech will read out the image src URL instead. 馃槵

More on this: https://davidwalsh.name/accessibility-tip-empty-alt-attributes

I agree, <g-image> should append a null/empty alt attribute if no value is given for alt. It's valid and probably nobody wants to hear the image's file name.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sidekaraktergendut picture sidekaraktergendut  路  3Comments

tyrion picture tyrion  路  3Comments

tanc picture tanc  路  3Comments

NickStees picture NickStees  路  3Comments

upandfine picture upandfine  路  3Comments