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

fix(core): remove title attributes, add alt attributes #1349

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

koeaw
Copy link
Contributor

@koeaw koeaw commented Nov 5, 2024

Remove (as per the HTML spec) discouraged title attributes from links in footer template and instead use their values for missing (also per the HTML spec) alt attributes on images they enclose.

Solves one of the issues described in #1343.

@b1rger
Copy link
Contributor

b1rger commented Nov 5, 2024

Oke, so without the title attribute there is now no information about what the icons represent, this was very informative. What do you suggest we use instead?

@koeaw
Copy link
Contributor Author

koeaw commented Nov 5, 2024

Oke, so without the title attribute there is now no information about what the icons represent, this was very informative. What do you suggest we use instead?

I'm not sure I understand. The idea of icons (symbols/pictograms) is to convey meaning. The textual description exists for those who can't access the visual; I moved those to the images' alt attributes, unchanged, which is where they serve that purpose much better.

If the symbols aren't clear enough, which is why I flagged the Git logo, we shouldn't use them. One solution is to find better (more obvious, less ambiguous) symbols, another is to use link text.

@b1rger
Copy link
Contributor

b1rger commented Nov 5, 2024

One solution is to find better (more obvious, less ambiguous) symbols, another is to use link text.

and a third is to show descriptive information when hovering those symbols or text. and the benefit of this approach is, that it can be combined with any of the other two!

@gythaogg
Copy link
Contributor

gythaogg commented Nov 6, 2024

alt won't show a tooltip on hover, right? I believe it is meant to be an alternative when the image doesn't load at all or for screen readers to know what the image is. So @b1rger do you suggest we keep the title; and @koeaw is it okay for title to remain alongside alt?

@koeaw
Copy link
Contributor Author

koeaw commented Nov 6, 2024

alt won't show a tooltip on hover, right? I believe it is meant to be an alternative when the image doesn't load at all or for screen readers to know what the image is. So @b1rger do you suggest we keep the title; and @koeaw is it okay for title to remain alongside alt?

The HTML spec itself says that use of title is discouraged. Please see the links I provided here, including coverage of the topic by A11y experts (going back years).

Using both attributes in parallel has its own problems, not sure if those are discussed in the articles I linked or in resources they, in turn, point to.

So no, I don't think that keeping titles for tooltips for visuals which ought to be self-explanatory outweighs the negatives.

@gythaogg
Copy link
Contributor

gythaogg commented Nov 6, 2024

alt is great for accessibility but the tooltip provided by title is a feature too, and one that at least I have often found useful. You are right in that visuals ought to be self explanatory but my brain doesn't always work fast enough on small icons and I hover over them to know quickly what they are about. I don't know why we must undo this feature to provide alt.

Using both attributes in parallel has its own problems, not sure if those are discussed in the articles I linked or in resources they, in turn, point to.

I was suggesting that they both have the same content, which is tolerated by the A11Y guys as title doesn't hide any extra information. See quote below from the page you linked

 If you must use title on images, keep it the same as the alt.

@b1rger
Copy link
Contributor

b1rger commented Nov 6, 2024

So @b1rger do you suggest we keep the title;

I suggest to have some information displayed when hovering over the icons. It doesn't have to be implemented using the title attribute, that why I asked for alternatives in my first comment.

The HTML spec itself says that use of title is discouraged.

The link you posted says: "Relying on the title attribute is currently discouraged" (emphasis added by me). We are not relying on the use of the title attribute. The "use of title" is a paraphrasing of you to underline your point. From an A11y perspective it is recommended not to rely on color to communicate the meaning of elements. Does this mean we should remove all the colors from our interface?

So no, I don't think that keeping titles for tooltips for visuals which ought to be self-explanatory outweighs the negatives.

Given that you have not listed any negatives but only mentioned that there are some, we can not comment on this.

Just for reference, a couple of examples from other user interfaces:

Gitlab:

image

image

image

image

image

image

Nextcloud:

image

image

image

image

Github:

image

image

image

image

image

Sharepoint:

image

image

image

image

image

image

@koeaw
Copy link
Contributor Author

koeaw commented Nov 6, 2024

@gythaogg Please let me know which changes you want me to make via the review tool. I can't/mustn't engage in lengthy discussions in issues and PRs for the time being. Thx.

Copy link
Contributor

@gythaogg gythaogg left a comment

Choose a reason for hiding this comment

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

title attribute here serves a purpose (tooltip) and hence it should remain. Please leave title with the same value as alt (as suggested by the a11yproject).

If you must use title on images, keep it the same as the alt.
...
In cases where a title attribute is provided, it should have the same value as the alt.

@koeaw koeaw force-pushed the kk/fix/footer_title_alt_attributes branch from 3692e88 to db02509 Compare November 6, 2024 16:32
Add missing `alt` attributes to images in footer
template using values identical to those of the
`title` attributes of the links enclosing the
images (as recommended by a11yproject.com when
both attributes are present).
@koeaw koeaw force-pushed the kk/fix/footer_title_alt_attributes branch from db02509 to 2067c99 Compare November 6, 2024 16:34
@koeaw
Copy link
Contributor Author

koeaw commented Nov 6, 2024

title attribute here serves a purpose (tooltip) and hence it should remain. Please leave title with the same value as alt (as suggested by the a11yproject).

Commit updated to only add alt attributes to <img> elements, reusing text used in title attributes.

Commit message updated to reflect change, additionally replaced mentions of "icons" with "images" for more accuracy re: affected elements. CC type in subject changed to feat.

@koeaw koeaw requested a review from gythaogg November 6, 2024 16:56
@koeaw koeaw merged commit cfa9006 into main Nov 7, 2024
13 checks passed
@koeaw koeaw deleted the kk/fix/footer_title_alt_attributes branch November 7, 2024 10:43
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.

3 participants