Skip to content
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

Improve the sidebar banner links accessibility and layout #11234

Merged
merged 7 commits into from Nov 13, 2018

Conversation

afercia
Copy link
Contributor

@afercia afercia commented Oct 11, 2018

Summary

This PR can be summarized in the following changelog entry:

  • N/A

Relevant technical choices:

Previously, each banner in the sidebar had two links: the image and the text. Although the image has an empty alt attribute alt="" it can be still navigated to with screen readers using arrow navigation. Since there's nothing else to announce, screen readers will announce the link URL or part of it:

screen shot 2018-10-11 at 14 04 45

In this case, the best option is to combine the two adjacent links in one single link following this suggested WCAG technique: https://www.w3.org/TR/WCAG20-TECHS/H2.html which also allows to reduce the number of links pointing to the same resource.

  • combines adjacent links
  • removes rel="noopener noreferrer" see https://github.com/Yoast/wordpress-seo/issues/4605#issuecomment-425409923
  • makes the string "Remove these ads?" translatable: please double check this point, not sure making it not translatable was intentional, see feac22c
  • introduces a simple utility method WPSEO_Admin_Utils::get_new_tab_message() to get the accessible, visually hidden, message for links that open in a new browser tab
  • slightly improves the responsive view by making the sidebar horizontally centered

The only visual change is about the word "Free" (see below), which is now part of the link:

before:

screen shot 2018-10-11 at 12 33 02

after:

screen shot 2018-10-11 at 13 35 23

(this can be changed but the translatable string won't be so great)

Test instructions

  • test there are no visual or layout regressions

Fixes #10338

Copy link
Contributor

@andizer andizer left a comment

Choose a reason for hiding this comment

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

CR done

@@ -6,17 +6,18 @@
*/

$wpseo_plugin_dir_url = plugin_dir_url( WPSEO_FILE );
$new_tab_message = WPSEO_Admin_Utils::get_new_tab_message();
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you align the = by adding some space before it?

<strong><a target="_blank" rel="noopener noreferrer" href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/jv' ); ?>"><?php esc_html_e( 'Yoast SEO for WordPress course', 'wordpress-seo' ); ?></a></strong><br>
<a href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/jv' ); ?>" target="_blank">
<img src="<?php echo esc_url( $wpseo_plugin_dir_url . 'images/yoast_seo_for_wp_2.svg' ); ?>" alt="">
<strong><?php esc_html_e( 'Yoast SEO for WordPress course', 'wordpress-seo' ); ?></strong>
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use sprintf for the Yoast part.

@Dieterrr
Copy link
Contributor

CR done 👍
Fixed merge conflict.

@afercia
Copy link
Contributor Author

afercia commented Oct 29, 2018

Re: the rel noopener noreferrer thing, please see https://github.com/Yoast/wordpress-seo/issues/4605#issuecomment-425409923

New policy: only use noopener and only on non-yoast.com links.

@IreneStr
Copy link
Contributor

3rd CR 👍

@IreneStr
Copy link
Contributor

IreneStr commented Oct 30, 2018

Acceptance 🚧

  • The a11y-part looks good to me.
  • Although the idea of boyscouting slightly improves the responsive view my making the sidebar horizontally centered was nice, there are some unintended suboptimal consequences (see below). Therefore, please revert this change. We can change that in a separate issue/PR, if desirable.

In responsive view, there are two columns:
schermafbeelding_2018-10-30_om_14_00_59

Next, there is not very pretty hybrid of one and two columns:
schermafbeelding 2018-10-30 om 14 03 12

Finally, there is one column, which is nicely centered indeed 😄:
schermafbeelding 2018-10-30 om 14 08 26

@IreneStr
Copy link
Contributor

4th CR 👍

@andizer
Copy link
Contributor

andizer commented Nov 13, 2018

Acceptance done 👍

@andizer andizer added this to the 9.3 milestone Nov 13, 2018
@andizer andizer merged commit cc00392 into trunk Nov 13, 2018
@andizer andizer deleted the 10338-sidebar-banner-links-accessibility branch November 13, 2018 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants