foundation-emails icon indicating copy to clipboard operation
foundation-emails copied to clipboard

Accessibility in Emails

Open elliottregan opened this issue 9 years ago • 9 comments

How can we reproduce this bug?

Any component that generates a <table> element.

What did you expect to happen?

Add role="presentation" to the <table>.

What happened instead?

Without this ARIA Role, screen readers try to read the table as tabular data, which is incorrect.

What email clients does this happen in?

All, when a screen reader is being used.


Most of the time you can add a role="presentation" to the Inky component, in the case of <center>, it does not get applied correctly. Ideally, that role would automatically get applied during the build system to keep the working markup cleaner. I don't think there are any drawbacks to this because if you really wanted to display a <table> as tabular data, you would just build the table using the <table> element, not <container>.

Further Reading: http://blog.rebelmail.com/accessibility-in-email-part-ii/

elliottregan avatar Mar 13 '17 23:03 elliottregan

I'm happy to submit a PR for this, but unsure of the best approach.

elliottregan avatar Mar 13 '17 23:03 elliottregan

I ran into this issue again today. Having role="presentation" automatically added to tables in Inky components would be a boon for accessibility, but I wonder if it's also worth updating documentation to let people know how to do this.

didoesdigital avatar Jan 15 '18 09:01 didoesdigital

I've made a PR in the Inky repo. It might take some time before it gets approved and bubbles all the way into foundation-emails. If there's anyone who can help, that would be splendid, cause these repos seem dead.

Until then... ...since I am not using any tables in my emails other then the generated ones by Inky, for now I just go with a simple task, that I call everywhere after inline. It appends the role="presentation" to each table. I hope this hack helps someone:

return gulp.src('dist/**/*.html')
  .pipe($.if(PRODUCTION, $.replace('<table', '<table role="presentation"')))
  .pipe(gulp.dest('dist'));

davidpustai avatar Jun 20 '18 17:06 davidpustai

Any updates?

garyanikin avatar Feb 05 '20 14:02 garyanikin

Any updates?

No as you can see =)

Any help is very welcome.

DanielRuf avatar Feb 05 '20 15:02 DanielRuf

I've made a PR in the Inky repo.

Not sure wich one. In such cases please always link it.

DanielRuf avatar Feb 05 '20 15:02 DanielRuf

There it is: https://github.com/foundation/inky/pull/102/files Also relevant: https://github.com/foundation/inky/pull/114

DanielRuf avatar Feb 05 '20 15:02 DanielRuf

Bump because this would be an improvement still 💯

nicksiscoe avatar Feb 25 '22 18:02 nicksiscoe

+1

elcaptain avatar Apr 11 '22 16:04 elcaptain