Skip to content

Conversation

@susnux
Copy link
Contributor

@susnux susnux commented May 19, 2023

Summary

Follow up on #38333

The current star color (yellow) does not work for accessibility as the contrast is too low on the default background color, we need at least a contrast of 3:1 but it only had 1.5:1. So the first part of this PR adjusts the star color to "gold" which works with --color-main-background on dark and bright color themes as well as with the hover background colors.

The second parts adjusts the favorite marker it self, as there are too many possible colors (folders = primary color, default icon = gray, preview images = random colors) the favorite marker is now placed with a slim border of 2px (circle) to get a consistent background for contrast (similar to the online status on avatar).

Screenshots

before after
image image

Second version of the PR:

Details
before after
image image

Fist version of the PR:

Details

The current color does not work on the default bright color theme as it does not provide a contrast of at least 3:1.

Screenshots

before after
image image
image image

Checklist

@susnux susnux added design Design, UI, UX, etc. 3. to review Waiting for reviews accessibility labels May 19, 2023
white: 'fff',
yellow: 'FC0',
// gold but for backwards compatibility called yellow
yellow: 'a08b00',
Copy link
Member

Choose a reason for hiding this comment

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

For me the contrast to the normal file icons is not getting too low. I can barely see it.
Also not sure if we need 3:1 by default (AA) or only in high contrast (AAA)

Copy link
Member

Choose a reason for hiding this comment

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

I think this is about 2 different things right?

  1. The action in the drop down (always against white/dark background, can simply use the color of all other action icons)
  2. The icon on top of the filetype icon or worse thumbnail in the files list.
    I'm not sure we can find a matching color for that that won't fail with any file type icon.
    So maybe we need to add a border on the icon like shown here:
    https://www.w3.org/WAI/WCAG21/Understanding/non-text-contrast.html#figure-two-star-ratings
    Or we have to do something else, since the icon is now basically invisible:
    grafik

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I tried to find a matching color, but I do not think one exist. Because the color of the default filetype icons (gray), primary color for folders (blue) and background color (white) do not allow any yellowish color with enough contrast.

The current "gold" color does only work for white and black (and some slight gray like the hover colors).

Thats why I now think adding a "border" around the favorite marker is the only working solution as it makes the color independent from the filetype and preview images.

@susnux susnux changed the title Adjust color of icon-starred-yellow to fulfill A11Y contrast requirements Adjust files favorite marker to fulfill A11Y contrast requirements May 19, 2023
@susnux susnux force-pushed the fix/a11y-files-favorite branch from 4f6d4dc to 24d2bd8 Compare May 19, 2023 21:34
Copy link
Member

@jancborchardt jancborchardt left a comment

Choose a reason for hiding this comment

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

Seems good, some questions / feedback:

  • I’d say it’s better to keep the star in the top right, as bottom right is where the status is usually on avatars. Having it on the top right makes it very clear it’s a filename with a star vs an avatar with a status.
  • The star has a circle around it which looks a bit off. Can it just be a star-shaped thick transparent gap?
  • Is the contrast 3:1 not about text elements? Graphic elements have different contrast requirements?

@susnux
Copy link
Contributor Author

susnux commented May 21, 2023

I’d say it’s better to keep the star in the top right, as bottom right is where the status is usually on avatars. Having it on the top right makes it very clear it’s a filename with a star vs an avatar with a status.

I chose the lower right over the top, because the filetype icons have spacial outline on the right top (e.g. the "corner").
But I am fine with every position :)

The star has a circle around it which looks a bit off. Can it just be a star-shaped thick transparent gap?

I can create a mockup for this.

Is the contrast 3:1 not about text elements? Graphic elements have different contrast requirements?

3:1 is for text AA level and graphic elements, for text AAA level 4.5:1. Especially if we want BITV we need 3:1 for graphical elements.

@nickvergessen
Copy link
Member

From my POV the "gold" is so far off from being a shiny yellow start, that we could also just make it black. It's not attention driving anymore anyway.

@susnux
Copy link
Contributor Author

susnux commented May 22, 2023

From my POV the "gold" is so far off from being a shiny yellow start, that we could also just make it black. It's not attention driving anymore anyway.

@nickvergessen
I agree, but yellow on white does not work 😞 For 3:1 contrast only that "old gold" or more orange would work.
But instead of black I would use primary color, it is more eye catching, at least if not all files are folders (as folders are already colored primary).


@jancborchardt
Here are some alternatives which might be better:

screenshot what
image Golden star with star shaped background
image Golden star with round background like the user status
image Primary star with round background like the user status
image Black outline with yellow star for more contrast

(My personal preference of those would be the primary star with round background)

But there is an other option which I kind of like: Removing the star from the thumbnail and move the "favorite" action from the files actions to be always the first action. This way the favorite marker is also a usable action:
image

@jancborchardt
Copy link
Member

@susnux thanks! :) The first proposal looks by far best. The border around it should just be a bit rounded so it’s not so spiky.

And yes, it needs to be in the top right, as in the bottom right we have the status, and as @nickvergessen said the star is also used for Talk conversations which can have the status icon in the bottom right for 1on1 conversations.

@susnux
Copy link
Contributor Author

susnux commented May 26, 2023

@jancborchardt is this enough roundness?
image

If yes then it would look like this:

bright dark
image image
image image

@nickvergessen
Copy link
Member

I'd still heavily prefer the "Black outline with yellow star for more contrast" instead of that no color brown replacement making it not stand out anymore

@susnux susnux force-pushed the fix/a11y-files-favorite branch from 24d2bd8 to ae789e3 Compare May 26, 2023 14:41
@susnux susnux requested a review from jancborchardt May 30, 2023 09:56
Copy link
Member

@jancborchardt jancborchardt left a comment

Choose a reason for hiding this comment

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

@susnux could be a bit more rounded off but looks good! :)

@nickvergessen the issue with the black border yellow filled is that it looks super close to just an empty black border star, which is what usually denotes non-favoriting.

@susnux

This comment was marked as outdated.

@jancborchardt
Copy link
Member

@susnux thanks! The inward parts were actually ok (now weirdly too rounded), it was mostly the tips which were too pointy. :)

@susnux susnux force-pushed the fix/a11y-files-favorite branch from d9d2c2f to a184bb5 Compare May 30, 2023 18:07
@susnux
Copy link
Contributor Author

susnux commented May 30, 2023

@jancborchardt Ok 😃 without rounding the inner corners it looks like this:
image

@susnux susnux force-pushed the fix/a11y-files-favorite branch from a184bb5 to 61712ad Compare May 30, 2023 18:09
Copy link
Member

@jancborchardt jancborchardt left a comment

Choose a reason for hiding this comment

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

Looks good! :)

@susnux susnux requested review from a team, Pytal and artonge and removed request for a team May 30, 2023 21:03
@susnux susnux requested a review from szaimen May 30, 2023 21:03
@susnux susnux force-pushed the fix/a11y-files-favorite branch 2 times, most recently from 09818e4 to 8ea74bc Compare May 30, 2023 21:15
@susnux
Copy link
Contributor Author

susnux commented May 30, 2023

Looks good! :)

Thank you! Rebased and squashed the commits, ready for reviews 😃

@susnux susnux force-pushed the fix/a11y-files-favorite branch from 8ea74bc to 6ebf160 Compare May 30, 2023 21:20
@susnux susnux force-pushed the fix/a11y-files-favorite branch from 6ebf160 to 35da64a Compare June 6, 2023 09:29
@susnux susnux merged commit 9ed4040 into master Jun 6, 2023
@susnux susnux deleted the fix/a11y-files-favorite branch June 6, 2023 12:19
@AndyScherzinger AndyScherzinger added this to the Nextcloud 28 milestone Jun 6, 2023
@susnux susnux mentioned this pull request Jul 6, 2023
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews accessibility design Design, UI, UX, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BITV] 9.1.4.11/3.4 - The "Favorites" yellow star does not meet the contrast requirements for graphical informative elements. (2)

6 participants