-
Notifications
You must be signed in to change notification settings - Fork 982
[Accessibility] - add attributes for accessibility in MjBody #2954
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Accessibility] - add attributes for accessibility in MjBody #2954
Conversation
|
Hi @llepere, as per the link provided in the pull request: ARIA: main role - ARIA | MDN , only one main role should be present per document, which poses a problem for those using webmail clients which already use role=”main”. Advice is to use the following:
.. where ‘email name’ should be a useful descriptor of the email, e.g. the subject line. |
Hi @DazGreerMJ I've made the changes. Is it good for you ? :) |
|
thanks @llepere, The attributes are all good, but where it says Probably best to use |
- Add two aria descriptors for accessibility purpose - Rename role main into role article
fe15b90 to
13294b0
Compare
|
Thanks @llepere, that's great! |
|
Hey @llepere, please can you update the README.md copy for mj-body from: This is the starting point of your email. .. to ... This is the starting point of your email. To aid accessibility, MJML automatically adds a Thanks |
The readme is updated 👍🏻 |
- Explain the change of mjml-body for accessibility in the readme.
c51c040 to
870feea
Compare
TLDLR; Add role article and two ARIA descriptors to MjBody
For accessibility the main landmark is important to point the user to the main content of the email and navigate easily with a screen reader. We can use the<main>tag or add arole="main"to a<div>We don't use
<main>tag here because of some limitations from email providers (Outlook, Gmail, etc.).So update the MjBody class to addrole: 'main'as parameter inhtmlAttributesfunction.So update the MjBody with a
role: 'articleand two ARIA-descriptors (see comment below here)More on main here