black-studio / black-studio-tinymce-widget

Black Studio TinyMCE Widget plugin for WordPress
https://wordpress.org/plugins/black-studio-tinymce-widget/
GNU General Public License v3.0
22 stars 13 forks source link

Improving the About plugin link #46

Closed sabernhardt closed 2 years ago

sabernhardt commented 3 years ago

Looking at WordPress Trac #35717, the old icon16 classes may be deprecated soon. This plugin contains the following link:

https://github.com/black-studio/black-studio-tinymce-widget/blob/cc8905178480ba3e6a698e3ea39ad1f7726c3fbb/src/admin/class-admin.php#L207

Switching to dashicons would only make a slight visual difference, which you could adjust further:

  1. Change the class list on line 207 (shown above) from bstw-links-icon icon16 icon-plugins to bstw-links-icon dashicons-before dashicons-admin-plugins

  2. Edit the CSS selectors from .icon16 to .dashicons-before

https://github.com/black-studio/black-studio-tinymce-widget/blob/cc8905178480ba3e6a698e3ea39ad1f7726c3fbb/css/black-studio-tinymce-widget.css#L19-L32

Screenshot before editing:

Current: with icon16 classes

After editing, the icon is slightly larger and blue:

With dashicons, the icon is slightly larger, blue, and with different spacing

Accessibility

This link has no text content, and not every screen reader announces the title attribute. For a small fix, the markup could be revised to include an aria-label:

    /* translators: text used for the icon that shows the plugin links */
    $link_title = esc_attr( __( 'About Black Studio TinyMCE Widget plugin', 'black-studio-tinymce-widget' ) );
    echo "\t\t<a class='bstw-links-icon dashicons-before dashicons-admin-plugins' href='#' title='" . $link_title . "' aria-label='" . $link_title . "'></a>\n";

To make it more usable for everyone, you could convert the link to a button instead, add visible link text and then remove the title and aria-label attributes, and clarify programmatically that the button expands and collapses the link list.

marcochiesi commented 3 years ago

Thank you @sabernhardt for your contribution. I will include the suggested changes in the next version of the plugin.