Skip to content

fix(docs-infra): apply various a11y aio improvements#45209

Closed
dario-piotrowicz wants to merge 5 commits into
angular:masterfrom
dario-piotrowicz:aio-a11y-improvements
Closed

fix(docs-infra): apply various a11y aio improvements#45209
dario-piotrowicz wants to merge 5 commits into
angular:masterfrom
dario-piotrowicz:aio-a11y-improvements

Conversation

@dario-piotrowicz

@dario-piotrowicz dario-piotrowicz commented Feb 26, 2022

Copy link
Copy Markdown
Contributor

changes:

  • currently the navigation ul used in aio-top-menu has a role of
    navigation, but listitems should be owned by list parents
    (see more: https://www.w3.org/TR/wai-aria-1.1/#listitem)
    so wrap the ul in a nav and remove the role="navigation" from the
    ul element to fix such issue
  • wrap the main aio mat-toolbar in a header element to provide better
    accessibility
  • remove reduntant role="main"
  • (try to) make sure that there in only a single main in the aio page
  • (try to) make sure all elements are included in landmarks
  • (try to) make sure the main navs have different labels

resolves #16938
resolves #44562

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

Does this PR introduce a breaking change?

  • Yes
  • No

@dario-piotrowicz dario-piotrowicz force-pushed the aio-a11y-improvements branch 3 times, most recently from 635d4b3 to 3233964 Compare February 27, 2022 13:12
@ngbot ngbot Bot modified the milestone: Backlog Feb 28, 2022
@jessicajaniuk jessicajaniuk added the target: patch This PR is targeted for the next patch release label Feb 28, 2022

@jessicajaniuk jessicajaniuk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🍪

I love seeing this a11y work, @dario-piotrowicz. Keep up the great work!

@dario-piotrowicz

Copy link
Copy Markdown
Contributor Author

@gkalpak could you have a quick look at this one please? 😊

@mary-poppins

Copy link
Copy Markdown

You can preview 2e2280f at https://pr45209-2e2280f.ngbuilds.io/.
You can preview 603c996 at https://pr45209-603c996.ngbuilds.io/.
You can preview 635d4b3 at https://pr45209-635d4b3.ngbuilds.io/.
You can preview 3233964 at https://pr45209-3233964.ngbuilds.io/.

@gkalpak gkalpak left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, @dario-piotrowicz 👏

BTW, in the future, it is a good idea to break up such changes into separate commits 😉

Comment thread aio/scripts/test-aio-a11y.mjs Outdated
Comment thread aio/content/guide/hierarchical-dependency-injection.md Outdated
Comment thread aio/src/styles/2-modules/code/_code-theme.scss Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this increases the contrast between the anchor text and the background, it makes it harder to distinguish the anchor text from the regular text, which is not good a11y/UX either. Could we maybe make this a little lighter (and still meet contrast requirements)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll have a look 🙂👍

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated it to #055cff (please let me know if you mind the hex there instead of a constant 😓)

This is how it looked before:
Screenshot at 2022-03-16 22-11-53
and this is after:
Screenshot at 2022-03-16 22-11-34

we do get the AA check

what do you think? 🙂
is the blue a bit too vibrant? 😓

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a bit too vibrant for my taste. It feels a lit out of place with the test of our color-palette 😞
(We could really use a designer 👀 😛)

@dario-piotrowicz

Copy link
Copy Markdown
Contributor Author

@gkalpak thanks a lot for the speedy review! ❤️ 😍 ❤️ 😍 ❤️ 😍 ❤️ 😍

@dario-piotrowicz

Copy link
Copy Markdown
Contributor Author

Great work, @dario-piotrowicz clap

BTW, in the future, it is a good idea to break up such changes into separate commits wink

About the commits, yeah sorry I did started that way but then things were intertwining and I just figured I could just mash it into a single one 😅, as part of my next changes to this PR I can put the effort and try to divide stuff in ways that make sense, I am totally fine with that, it should not be too much of an issue if you want 🙂

(also the commits would be a bit small, hopefully you don't mind that 😄)

@gkalpak

gkalpak commented Mar 16, 2022

Copy link
Copy Markdown
Member

as part of my next changes to this PR I can put the effort and try to divide stuff in ways that make sense

No, no need for that. Just something to keep in mind for future PRs 😉

also the commits would be a bit small, hopefully you don't mind that 😄

We certainly don't mind small commits (as long as they are self-contained) 😃

@dario-piotrowicz

Copy link
Copy Markdown
Contributor Author

@gkalpak I've addressed your comments, please have another look 😊

@dario-piotrowicz dario-piotrowicz force-pushed the aio-a11y-improvements branch 2 times, most recently from 5c53094 to 718f709 Compare March 22, 2022 19:59
@mary-poppins

Copy link
Copy Markdown

You can preview 718f709 at https://pr45209-718f709.ngbuilds.io/.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: If we decide to keep this (or any color we end up with), we need to make sure that links inside code-blocks have the same color (and the color has to be accessible with both the default white-ish background and the gray code-block background).

currently the navigation ul used in aio-top-menu has a role of
navigation, but listitems should be owned by list parents
(see more: https://www.w3.org/TR/wai-aria-1.1/#listitem)
so wrap the ul in a nav and remove the role="navigation" from the
ul element to fix such issue

resolves angular#44562
resolves angular#16938 (the second point)
wrap the main aio mat-toolbar in a header element to provide better
accessibility

resolves angular#16938 (the first point)
remove redundant main role as pages should always have a
single element with a main role (also remove the role assigne
to the main tag as that is implied)
assign different aria labels to the primary nav and the one used for
guides and docs, so that impaired users can more easily distinguish the
two
@mary-poppins

Copy link
Copy Markdown

You can preview 7409b7e at https://pr45209-7409b7e.ngbuilds.io/.

update (decrease) the value of some of the accessibility MIN_SCORES_PER_PAGE
after recent changes
Comment thread aio/scripts/test-aio-a11y.mjs
@dario-piotrowicz

Copy link
Copy Markdown
Contributor Author

@gkalpak I've removed the color changes as those seems to be a bit tricky and could be handled separately, please have another look 🙂

(also now unfortunately the a11y scores are now going slightly down instead of going up 😭)

@mary-poppins

Copy link
Copy Markdown

You can preview 8077771 at https://pr45209-8077771.ngbuilds.io/.

@gkalpak gkalpak left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@gkalpak gkalpak removed the request for review from alxhub March 29, 2022 10:17
@gkalpak gkalpak added the action: merge The PR is ready for merge by the caretaker label Mar 29, 2022
@dylhunn

dylhunn commented Mar 29, 2022

Copy link
Copy Markdown
Contributor

This PR was merged into the repository by commit 16e635c.

dylhunn pushed a commit that referenced this pull request Mar 29, 2022
currently the navigation ul used in aio-top-menu has a role of
navigation, but listitems should be owned by list parents
(see more: https://www.w3.org/TR/wai-aria-1.1/#listitem)
so wrap the ul in a nav and remove the role="navigation" from the
ul element to fix such issue

resolves #44562
resolves #16938 (the second point)

PR Close #45209
dylhunn pushed a commit that referenced this pull request Mar 29, 2022
wrap the main aio mat-toolbar in a header element to provide better
accessibility

resolves #16938 (the first point)

PR Close #45209
dylhunn pushed a commit that referenced this pull request Mar 29, 2022
remove redundant main role as pages should always have a
single element with a main role (also remove the role assigne
to the main tag as that is implied)

PR Close #45209
dylhunn pushed a commit that referenced this pull request Mar 29, 2022
assign different aria labels to the primary nav and the one used for
guides and docs, so that impaired users can more easily distinguish the
two

PR Close #45209
dylhunn pushed a commit that referenced this pull request Mar 29, 2022
update (decrease) the value of some of the accessibility MIN_SCORES_PER_PAGE
after recent changes

PR Close #45209
@dylhunn dylhunn closed this in 7ef0717 Mar 29, 2022
dylhunn pushed a commit that referenced this pull request Mar 29, 2022
wrap the main aio mat-toolbar in a header element to provide better
accessibility

resolves #16938 (the first point)

PR Close #45209
dylhunn pushed a commit that referenced this pull request Mar 29, 2022
remove redundant main role as pages should always have a
single element with a main role (also remove the role assigne
to the main tag as that is implied)

PR Close #45209
dylhunn pushed a commit that referenced this pull request Mar 29, 2022
assign different aria labels to the primary nav and the one used for
guides and docs, so that impaired users can more easily distinguish the
two

PR Close #45209
dylhunn pushed a commit that referenced this pull request Mar 29, 2022
update (decrease) the value of some of the accessibility MIN_SCORES_PER_PAGE
after recent changes

PR Close #45209
@dario-piotrowicz dario-piotrowicz deleted the aio-a11y-improvements branch April 9, 2022 12:30
@angular-automatic-lock-bot

Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators May 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release type: bug/fix

Projects

None yet

5 participants