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 accesibility for Manage theme fonts page #271

Closed
wants to merge 3 commits into from

Conversation

kishanjasani
Copy link

@kishanjasani kishanjasani commented Mar 11, 2023

Issue: #230

  • The expand/collapse icon on each font family heading is missing a label. I think we should add a label based on these best practices.
    -> Add aria-expands: true/false based on the user action, Also added aria-label to the button and aria-hidden: true for icon.

  • It would be good to add the name of the font family in each remove button, so it's clear which font family they are linked to. For example, add an aria-label with the contents, "Remove DM Sans font family".
    -> Add aria-label for button and aria-hidden: true for icon.

  • Similar to above, it would be good to add an aria-label to the font face buttons too.
    -> Similarlly, Adds aria-label for button and aria-hidden: true for icon.

  • The tab order of the font size range control is reversed because the flex-direction is set to row-reverse. This is probably because the RangeControl component only allows for the input to be shown on the right, and in this case, it works better on the left. I'm not sure what's possible here but thought it was worth mentioning. Maybe we could look into changing the tab order somehow.

All checked item has been improved, the last one is pending. Last item needs discussion, how we can improve that? Needs
you opinion.

@mikachan mikachan self-requested a review March 24, 2023 18:03
Copy link
Member

@mikachan mikachan left a comment

Choose a reason for hiding this comment

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

Thanks so much for working on this!

I've left a couple of inline comments, but this needs to be rebased so it's up-to-date with the latest changes from the plugin. Please could you do that, and I'll take another look 🙇

<div>
<RangeControl
<div className="font-size-input">
<NumberControl
Copy link
Member

Choose a reason for hiding this comment

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

Does the NumberControl work OK if it's placed after the RangeControl? I believe this is the intended design, so it would be great if we could keep it like that:

image

Comment on lines +62 to +66
aria-label={ sprintf(
/* translators: %s: Font Family. */
__( 'Remove %s Font Family' ),
fontFamily.name || fontFamily.fontFamily
) }
Copy link
Member

Choose a reason for hiding this comment

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

Nice!

Comment on lines +73 to +88
<Button
variant="tertiary"
onClick={ toggleIsOpen }
aria-expanded={ isOpen }
aria-label={
isOpen
? __(
'Collapse Font Family',
'create-block-theme'
)
: __(
'Expand Font Family',
'create-block-theme'
)
}
>
Copy link
Member

Choose a reason for hiding this comment

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

👍

@@ -192,8 +192,9 @@ function ManageFonts() {
<Button
onClick={ toggleIsHelpOpen }
style={ { padding: '0', height: '1rem' } }
aria-label={ __( 'Alert Popup', 'create-block-theme' ) }
Copy link
Member

Choose a reason for hiding this comment

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

I'd maybe label this as something like 'More information' or 'Additional information', rather than 'Alert'.

Copy link
Author

Choose a reason for hiding this comment

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

@mikachan Thanks for your feedback.

@kishanjasani
Copy link
Author

@mikachan I think we need to create another PR for it. there are many changes in the font page.

@mikachan
Copy link
Member

mikachan commented May 9, 2023

I think we need to create another PR for it. there are many changes in the font page.

Yeah that's true, it's probably easier to handle the changes in a new PR 👍

@vcanales
Copy link
Member

vcanales commented Apr 3, 2024

Thanks for your contribution! Font management is being handled by core now, so we're working towards removing it from the plugin on the next release.

@vcanales vcanales closed this Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants