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

XWIKI-21216: Lack of contrast on hover of lightbox buttons when expanded #2297

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Sereza7
Copy link
Contributor

@Sereza7 Sereza7 commented Aug 16, 2023

Jira

https://jira.xwiki.org/browse/XWIKI-21216

PR Changes

  • Replaced hard coded colors with panel values from the color theme.

View

Hereafter are four screenshots of the involved changes. They come in pairs, the first being the state before the changes proposed here, and the second being the state after the changes proposed here. On all of those screenshot, the :hover style has been applied on the leftmost button. The green highlight is created by an extension.

(a) Modal with the Iceberg color theme, before
21216-icebergBefore
(b) Modal with the Iceberg color theme, after
21216-IcebergAfterPR

(c) Modal with the Darkly color theme, before
21216-DarklyBefore
(d) Modal with the Darkly color theme, after
21216-DarklyAfterPR

* Replaced hard coded colors with panel values from the color theme.
Copy link
Contributor

@michitux michitux left a comment

Choose a reason for hiding this comment

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

From a technical point of view I agree. However, making the background white/gray instead of black is quite a change and not typical for this kind of lightbox, so I think we should have a forum proposal for this.

opacity: 1;
}

.action {
color: @xwiki-page-content-bg;
color: @panel-default-text;
opacity: 0.8;
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought it was a bad idea to use opacity with colors?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I chose to use an opacity of 0.8 here since we don't have a variation of @text-muted that would match the color in @panel-default-text (something like @panel-muted-text). See this ticket and this topic on the forum for a discussion about the state of panel colours in the colorthemes.

Opacity can reduce the importance of a text on both light and dark theme, which is not true for the LESS color operation functions lighten/darken.

This is not a perfect solution, but I think this is the one with the least drawbacks.

background-color: rgba(0, 0, 0, 0.6);
color: #FFFFFF;
background-color: @panel-bg;
opacity: 0.6;
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't the opacity dangerous in terms of contrast?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was already there in the previously hard coded color. I think this is too much of a change to remove it and there is a genuine point to opacity here (we want to still see content behind).

I insisted to remove it on some other PRs, because transparency was not necessary but just a mean to change the color, and we had easy alternative with full semantically appropriate colors from the theme.

@Sereza7 Sereza7 marked this pull request as draft September 14, 2023 11:36
@Sereza7
Copy link
Contributor Author

Sereza7 commented Sep 14, 2023

Started a forum topic about the solution proposed here

https://forum.xwiki.org/t/lightbox-modal-background/13114

@Sereza7
Copy link
Contributor Author

Sereza7 commented Dec 6, 2023

Conclusion of the forum feedback:

  • enforcement of the no-hardcoding codestyle is not paramount here.
  • The whit-ish dropdown on Iceberg does not look good

Sereza7 and others added 2 commits December 20, 2023 17:10
* Added back hard coded color, but removed the color theme ones so that we don't break contrast on half the themes.
@Sereza7
Copy link
Contributor Author

Sereza7 commented Dec 20, 2023

Updated the lightbox UI to avoid breaking contrast with some color themes. Now all colors are hard coded.
Here are the new proposed looks for the lightbox, with the Iceberg color theme and the Darkly color theme:
21216-afterPRIceberg2
21216-afterPRDarkly2

@Sereza7 Sereza7 marked this pull request as ready for review December 20, 2023 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants