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

Fixing color picker accessibility #11303

Closed
wants to merge 1 commit into from
Closed

Fixing color picker accessibility #11303

wants to merge 1 commit into from

Conversation

aldavigdis
Copy link
Contributor

Description

Attempts to cover part 1 of #10975.

  • Replacing some abbriviations with proper abbr tags
  • Other abbriviations have been replaced with full names

How has this been tested?

Manual testing. I did not attempt to fix the VoiceOver bug in #10975

Screenshots

screenshot 2018-10-31 at 14 22 10

screenshot 2018-10-31 at 14 22 24

Types of changes

No breaking changes. Those are only markup-related. No testing required as far as I know, unless the CI breaks. 🤞

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.

* Replacing some abbriviations with proper abbr tags
* Other abbriviations have been replaced with full names
@Soean Soean added the [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). label Oct 31, 2018
@ajitbohra ajitbohra requested a review from afercia January 23, 2019 07:35
@afercia
Copy link
Contributor

afercia commented Jan 23, 2019

Manual testing. I did not attempt to fix the VoiceOver bug in #10975

Note: there is no VoiceOver bug. The issue asked to test if what as mentioned in #10564 (review) could be reproduced. However, that testing was made on a Windows VM which is a non reliable environment to test with. What was needed there was merged in #10807

@@ -174,10 +174,11 @@ export class Inputs extends Component {
<fieldset>
<legend className="screen-reader-text">
{ __( 'Color value in RGB' ) }
<abbr title={ __( 'Red Green Blue' ) }>RGB</abbr>
Copy link
Contributor

Choose a reason for hiding this comment

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

Translatable strings shouldn't be split in two parts. Also, considering this is a legend and the field labels are expanded, I'd recommend to not use an <abbr> element at all, which has little real effect.

</legend>
<div className="components-color-picker__inputs-fields">
<Input
label="r"
label={ __( 'Red' ) }
Copy link
Contributor

Choose a reason for hiding this comment

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

Should use _x() to specify it refers to 'RGB color format'.

@@ -186,7 +187,7 @@ export class Inputs extends Component {
max="255"
/>
<Input
label="g"
label={ __( 'Green' ) }
Copy link
Contributor

Choose a reason for hiding this comment

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

Should use _x() to specify it refers to 'RGB color format'.

@@ -195,7 +196,7 @@ export class Inputs extends Component {
max="255"
/>
<Input
label="b"
label={ __( 'Blue' ) }
Copy link
Contributor

Choose a reason for hiding this comment

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

Should use _x() to specify it refers to 'RGB color format'.

@@ -205,7 +206,7 @@ export class Inputs extends Component {
/>
{ disableAlpha ? null : (
<Input
label="a"
label={ __( 'Alpha' ) }
Copy link
Contributor

Choose a reason for hiding this comment

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

Should use _x() to specify it refers to 'RGBA transparency'.

@@ -222,11 +223,12 @@ export class Inputs extends Component {
return (
<fieldset>
<legend className="screen-reader-text">
{ __( 'Color value in HSL' ) }
{ __( 'Color value in' ) }
<abbr title={ 'Hue Saturation Lightness' }>{ __( 'HSL' ) }</abbr>
Copy link
Contributor

@afercia afercia Jan 23, 2019

Choose a reason for hiding this comment

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

See above, I'd recommend to not use <abbr>. (also note the title is not translatable but let's remove the abbr all together)

Copy link
Contributor

Choose a reason for hiding this comment

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

You should use i18n %s placeholders. Use Color value in %s. This way, translators can control the location of the %s in the string when they translate to local languages.

</legend>
<div className="components-color-picker__inputs-fields">
<Input
label="h"
label={ __( 'Hue' ) }
Copy link
Contributor

Choose a reason for hiding this comment

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

Should use _x() to specify it refers to 'HSL color format'.

@@ -235,7 +237,7 @@ export class Inputs extends Component {
max="359"
/>
<Input
label="s"
label={ __( 'Saturation' ) }
Copy link
Contributor

Choose a reason for hiding this comment

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

Should use _x() to specify it refers to 'HSL color format'.

@@ -244,7 +246,7 @@ export class Inputs extends Component {
max="100"
/>
<Input
label="l"
label={ __( 'Lightness' ) }
Copy link
Contributor

Choose a reason for hiding this comment

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

Should use _x() to specify it refers to 'HSL color format'.

@@ -254,7 +256,7 @@ export class Inputs extends Component {
/>
{ disableAlpha ? null : (
<Input
label="a"
label={ __( 'Alpha' ) }
Copy link
Contributor

Choose a reason for hiding this comment

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

Should use _x() to specify it refers to 'HSLA transparency'.

Copy link
Contributor

@afercia afercia left a comment

Choose a reason for hiding this comment

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

Some points to address, please see comments.

@afercia
Copy link
Contributor

afercia commented Jan 23, 2019

@aldavigdis thanks for your PR 🙂 I've left some comments about a few points that should be addressed.

Also, I've asked on Slack #polyglots and #accessibility if terms like RGB, HSL, and the related colors should be translatable. Agreed to leave the choice to translators so yes, they should be translatable.

However, this creates a potential issue with longer strings provided by some languages. For example. for HSL the expanded labels already slightly alter the layout in English: the fields have different widths:

screenshot 2019-01-23 at 16 50 45

With longer translations, the problem would be more noticeable:

screenshot 2019-01-23 at 16 55 26

This needs to be addressed in some way, as the design didn't take internationalization into account.

@afercia afercia added the Needs Design Feedback Needs general design feedback. label Jan 23, 2019
@gziolo gziolo added this to the 5.0 (Gutenberg) milestone Jan 25, 2019
@gziolo
Copy link
Member

gziolo commented Jan 25, 2019

@aldavigdis are you going to address feedback shared by @afercia? It also looks like this PR needs to be rebased with the latest changes from master to resolve failures on Travis CI.

@gziolo gziolo added [Type] Copy Issues or PRs that need copy editing assistance Needs Copy Review Needs review of user-facing copy (language, phrasing) labels Jan 25, 2019
@michelleweber
Copy link

Is there any editorial copy review required here, or is this a translation and design issue?

@gziolo gziolo removed the Needs Copy Review Needs review of user-facing copy (language, phrasing) label Jan 25, 2019
@gziolo
Copy link
Member

gziolo commented Jan 25, 2019

@michelleweber - you are right, it looks like it doesn't need editorial copy. My mistake, sorry about that.

@gziolo gziolo removed this from the 5.2 (Gutenberg) milestone Mar 4, 2019
@gziolo gziolo added this to the 5.3 (Gutenberg) milestone Mar 4, 2019
@youknowriad youknowriad removed this from the 5.3 (Gutenberg) milestone Mar 18, 2019
@mapk
Copy link
Contributor

mapk commented Apr 5, 2019

@aldavigdis where are we with this PR? Will you continue working on this, or should we close it for now?

@aduth aduth added the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Apr 24, 2019
@aduth
Copy link
Member

aduth commented May 31, 2019

Closing as stale. Please propose a new pull request if you plan to continue the work here.

@aduth aduth closed this May 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Needs Design Feedback Needs general design feedback. [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. [Type] Copy Issues or PRs that need copy editing assistance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants